Atomic use cases,Features, WSP Solutions and VS solutions

August 7th, 2008 2 comments

I understand that each project has its own requirements and those requirements would dictate the layout of your VS solution(s) and the way you package your work into WSP solutions.

As I discussed this with other MVP and non-MVP devs, we finally came to a conclusion that there is no “best way” that fits all scenarios -for example, my buddy Dan Attis (MVP) uses an interesting methodology to package his work into very atomic units (each wrapped into a  feature) and grouped into a Visual Studio project  based on their relevancy and mapped to a WSP solution (SharePoint Solution). One or more projects are located in one VS solution (4 to date). His logic is:

Support , extensibility and maintainability is #1 concern due to the nature of our project ;therefore we need to make sure that future updates would run in the most abstracted way possible. Additionally, we would like all of our developers to be able to work in parallel.We have come up with 25 WSP solutions in total.

We pretty much can’t follow the above approach as we are a small group of developers (Maximum 3 people on a project – one is our designer), always under the delivery pressure, we build, deliver and move on to the next project. Although , this doesn’t mean that we do a poor job on what we do, for us, agile development usually outweighs the extra time required to plan and deal with the complexity of such granularity. In addition, the total number of support cases we have got in 2008 has been ZERO so far, whereas we have got our hands on four medium to large scale projects since Q1. We simply can’t afford anything that causes extra complexity and slows down our dev cycle, my QA (Yeah, I like finding issues 😉 ) and final deployment to the customer’s site.

Below is the way I normally layout my projects in one VS solution. Each project is wrapped into its own WSP solution and deployed in orders. Groping related bits together and abstracting them from each other in a reasonable manner, gives us the possibility for 2 devs to be working on the same project without affecting each other’s work. Sometimes and  based on the situation , I may merge two or more projects into one package , but generally speaking , my deployments are around 5 to 6  WSP packages max.

      Core (Class library – Deployed to GAC)

1.      This project is meant to host the code thatis meant to be used as the base for all other projects in the solution (Think about it as classic Common lib)

OR

2.      Can’t be placed in other projects (for example my membership provider bit)

      Controls (Class library – Deployed to bin folder)

1.      All Web parts and user controls

2.      If I need more granularity in terms of security, I abstract the control in its own assembly and apply more restricted CAS on it

       Infrastructure (Class library – Deployed to GAC)

1.      Custom Field Definitions

2.      Standalone Site columns  (Standalone site column is the one which is used in an standalone content type)

3.      Standalone Content types (Standalone Content type is the one which has no workflow attached to it)

4.      List Definitions

5.      Non-publishing Site Definitions

6.      Custom processes attached to the non-publishing Site Definitions (For example :Provisioning handler)

       Publishing (Class library – Deployed to GAC)

1.      Field controls used in publishing context

2.      Publishing site columns

3.      Publishing content types

4.      Workflows used in publishing context

5.      Web parts used in publishing context ( for example those derived from Content Query Web Part)

6.      Master pages and page layouts

7.      Custom xslts used in publishing context

8.      Delegate controls used in publishing context

9.      Publishing Site Definitions

10.  Custom processes attached to the publishing Site Definitions

       Workflows (Class library – Deployed to GAC)

1.      Site columns

2.      Content types

3.      Workflows used in non-publishing context

4.      InfoPath forms used in workflows as Initiation, Association and task forms

5.      Feature receivers to add content types to the appropriate lists or doc libs proviosned by Infrastructure solution

Categories: MOSS 2007 Tags:

Did you upgrade your SQL Server 2k8 RC0 to RTM? Don’t!

August 7th, 2008 3 comments

Check your Technet or MSDN subscription, SQL Server 2k8 RTM is official! Question is how to upgrade from RC0 to RTM?

Even if there was an upgrade path from RC0 to RTM (Not sure if there is any) , I’d still uninstall RC and install fresh RTM binaries. That’s mainly due to the unstable nature of CTP/RC releases and how can you verify that everything is working as expected? So , IMO there is risk associated with in-place upgrade .

Here are the steps I took on my main dev machine:

[Update Aug/08/2008] : Microsoft has just released this KB article describing the dependency of SQL Server 2008 on VS 2008 SP1. There are also some workarounds to temporarily get it installed until VS 2008 SP1 is installed.

[Update Aug/11/2008] Visual Studio 2008 SP1 is available for download here. In case you are still using .Net Framework 3.5 SP1 beta , make sure you uninstall and install the RTM bits available for download here. If you install both service packs , you should not get the following error while installing SQL Server 2008.

1) Detached admin,config and content databases that you wish to keep. You may have to drop connections if they are live.
2) Moved the file (*.mdf,*.ldf) to another folder other than SQL Server DATA folder in case uninstall delete your files.
3) Uninstalled RC0 and all its sub component.
4) Install RTM bits with the same settings as your RC0 -For example if you were using named instance , use the same installation approach, accounts and etc.

RTM bits requires .Net 3.5 SP1 and VS2008 SP1 which is not available yet. Looks like I can’t upgrade my RC0 to RTM until SP1 is released. Damn it!

5) Move the files back to the SQL Server DATA directory.
6) Attach ( or restore) your databases.
7) Add all application pool identities and the account you used to install SharePoint. In Microsoft SQL Server Management Studio , under Security folder, expand Logins folder and add the accounts.

Going from 32-bit to 64-bit direct?
You can’t! Cross platform upgrade is not supported unless you are going from 32 bit to WOW64. In case your databases are not in replication , you can also detach (or backup) from 32-bit SQL Server instance and attach( or restore) into a 64-bit sql server instance. Absolutely a supported scenario.


Categories: MOSS 2007 Tags:

Quick Note: WSS Version after Applying Infrastrucutre Rollup

August 7th, 2008 No comments

If you still haven’t applied three new important updates (a.k.s infrastructure rollup) to your SharePoint environment, then you should. These updates not only introduce new features , also patch several fixes to the top issues reported to Microsoft. Again , as you can see in the SharePoint team blog the order is important (highlighted section). Once you apply WSS rollup , the WSS runtime version should change to 12.0.0.6318 as follow:

InfraStructureUpdate3

For all other version numbers including the initial version and the updated version after applying SP , see this post.

Last but not least, make sure your environment & your code works as expected after applying these updates.

Categories: MOSS 2007 Tags:

Fun with remote TFS connectivity in VS Team Suit 2008

August 7th, 2008 1 comment

Yes, the story continues and I am having fun!!! 🙂

History: I have my TFS server hosted in US. It was initially provisioned as an standalone server and obviously there was a local administrator account(dhtfs\administrator). Let’s say , we chose “G@dBle$$America” for admin’s password. Later on , we joint the TFS machine to our domain (dhdc)  and exposed it via https to our remote developers for two main reasons:

1) We (myself and our project manager) could take advantage of TFS notifications sent to our exchange accounts.

2) Our remote developers can check-in , check out without having to VPN to our network and authenticating against our domain controller (dhdc).

As I aluuded to in the previous post, we built a base windows 2k8 server and sysprepped it to be able to roll it up on our VM and non-VM machines. Again, we used the same favorite password (G@dBle$$America) for the local administrator account (machinename\administrator) for the base sysprep image.

Issue1:  In *some* of the virtual machines (x64) provisioned from the same sysprep image (x64 ) . After I took care of the SharePoint issue (see number 4 in this post) and when developers tried to connect to our Team Foundation Server source control from the Team Explorer 2008 client installed on each machine., the following error appeared:

Unexpected error encountered. It is recommended that you restart the application as soon as possible.
Error: No such interface supported
File: vsee\lib\vscommodule\vscommod.cpp
Line number:173

TFSError

Was this a corrupted Team suit installation?Answer is No! because I found this KB article , tried the resolution and it solved the issue.

1. Open a command prompt.
2. Navigate to the following folder:
“%programfiles%\Microsoft Visual Studio 9\Common7\IDE\”
Note: in x64 machines (and since VS is still a 32-bit app), “%programfiles% is Program Files (x86)
3. Type this : devenv.exe /resetuserdata

Issue2: In *all* of the virtual machines (x64) , developers couldn’t use thier credentials to connect to the TFS.  Issue was when they added the TFS server  (Tools menu–> Connect to Team Foundation Server…), TFS didn’t challenge them to enter their username and password. Something was being cached , but didn’t I just flush out the current user’s data? We did a sample check-in , check-out and noticed that actions are performed under the “administrator” account , but which administrator account is this? We were not logged in to the domain, so it couldn’t be dhdc\administrator for sure.

Changed the TFS machine’s local administrator (dhtfs\administrator) password and we immediately got the credential prompt on remote clients. So the issue was the NTLM pass-through authentication which was mapping VM’s local admin (spvm2\administrator) to the TFS’s local admin (dhtfs\administrator) – as they were using the same password.

TFS’s local admin (dhtfs\administrator) was part of BUILTIN\administrators which in turn was a member of [SERVER]\Team Foundation Administrators group. That’s how the TFS machine’s  local admin (dhtfs\administrator) ended up as a high privliaged user in TFS. Here is a diagram of how mapping took place :

VisioDiagramSnagit

Categories: TFS Tags:

Fun with installing SharePoint on Win2k8

August 6th, 2008 11 comments

From the beginning of this month and mostly after work hours, I have been heads down building various *STANDALONE* VM and non-VM SharePoint development environments.  For the life of me , there is nothing more boring than dealing with all these infrastructural craps , but sometimes there is no other choice, you know!  Installation went fairly smooth on majority of the machines. I took some notes during the setup process and I thought I’d give you some bullet points in this blog post.

1) First of all, it took a good couple of hours to find out that sysprep in Windows 2k8 is located in “C:\windows\system32\sysprep\sysprep.exe” (Thanks to Kit Kai). Sysprep previously was in the Support.Cab file on the CD , not part of the OS. So you would extract the support.cab to a directory located at the Root and when the process finished upon first boot, it would delete this directory.

2) WSS 3.0 is no longer shipped as part of Windows 2008 server family. So the question is, why should it be named *Windows* SharePoint Service?I’m sure you will hear an answer soon from MS.

3) WSS 3.0 or MOSS 2007 binary files can’t be used to install SharePoint on a Windows 2008 server. You get a compatibility warning saying that the product is not compatible with win2k8. Fine.Thankfully, there is WSS SP1 slipstream and MOSS SP1 slipstream that sort of bundles each product with its respective SP1 together. Okay, we are good to go again.

4) After installing MOSS 2007 SP1 and running the configuration wizard successfully, I browsed to Central Administration and I receive a JavaScript error on all the Central Administration pages and on multiple lines saying “object expected”. When I tried to create a web application (extendvs.aspx) , there is another JavaScript error saying “Webform_postbackoptions is undefined”. Well, without post back, my SharePoint installation is useless.Isn’t it?  I tried all the followings, but the bad boy didn’t want to work:

* Added the site to my intranet zone
* Reinstalled MOSS 2007
* Cleared Cache, did IISRESET and you name it!
* Reinstalled the page (extendvs.aspx) from another server in which the page is properly functioning

Alternatively, I created the web application using stsadm , but upon brwosing to the site and choosing the right template to provision the site from , I got an “Access Denied” error message. Now, I know there is something seriously going on because I was doing all this using the administrator account which was also used to install SharePoint.

Armed with Firefox with Firebug (Fiddler was not helpful!), I put my debugger hat on and found out that I am getting an error on all of the scripts injected by webresource.axd http handler. ASP.NET 2.0 uses this built-in HttpHandler to serve
pages by publishing JavaScripts and other resources embedded in the OOTB SharePoint assemblies to various pages. btw, just as a side note, I’m not a big fan of embedding images,scripts,style sheets or some other content in compiled assemblies and relying on this http handler. In many cases ,I have seen that the WebResource.axd finds the resource, but returns nothing! so I kissed and put it aside. Too much headache. I’d stick to my old school file system way of shipping resources (inside my WSP solution). I am not cool! Yeah right….

Back to the issue. I ended up reinstalling the Application Server role, IIS and .Net framework 3.0 in the following orders , which basically was for me the fastest way to get up-and-running again. And yes, it fixed the issue!

1. Ran SharePoint products and technologies wizard to disconnect from the farm
2. Deleted the left over databases from SQL Server 2k8
3. Uninstalled Application Server Role
4. Uninstalled Web Server role (Uninstalls .Net Framework 3.0)
5. Restarted the machine.
6. Installed Application Server role
7. Installed the Web Server role (Installs .Net Framework 3.0)
8. Registered the aspnet with IIS using the command
“aspnet_regiis –i”
9. Ran SharePoint products and technologies wizard successfully to create a new farm

Categories: MOSS 2007 Tags: