Thursday, September 21, 2006

Installing SharePoint Services 3 on virtual machine after NewSID

For those of us addicted to virtual machines Sysinternals' tool NewSID comes in handy every time we clone that CleanSomeOs.vhd file. It changes the SID of the virtual machine in a snap with its wizard interface and unlike sysprep you do not need to re-configure localization settings. However if you plan to install Windows SharePoint Services (WSS v3) or Microsoft Office SharePoint Server (MOSS 2007) Beta most likely you will encounter the following error after you run the configuration wizard: System.InvalidOperationException ...

After a little research I found this MSDN article, which describes similar issue with WSS when installing TFS.

One way to go is to install a brand new OS on the VM, but this seemed like a lot of work especially if I needed to install WSS repeatedly and play with it. The suggested solution in the MSDN article did not work for me either. It is possible that my clean installation VHD has already been "tainted" by NewSID, so using sysprep meant going back to square one and installing fresh OS. After a bit more searching I found this blog, which addresses the issue in more suitable way. So all boils down to two major issues: 1. LOCAL SERVICE and NETWORK SERVICE have to members of the local group WSS_WPG and they are not. 2. Multiple registry keys related to WSS have corrupted permissions. The above article describes very well how to fix most of the registry keys. Nevertheless my system had additional entries corrupted in similar way and I had to dig in the log file and fix them. In addition I noticed that there is no need to assign privileges to registry entries.

I found the following corrupted registry entries HCR\AppID\{6002D29F-1366-4523-88C1-56D59BFEF8CB} and HCR\AppID\{58F1D482-A132-4297-9B8A-F8E4E600CDF6} . In addition the whole branch HLM\Software\Microsoft\Shared Tools\Web Server Extensions\12.0 seems to be with corrupted permissions, so instead of fixing the underlying registry keys one by one I simply deleted the rouge permission entries for the whole branch.

All of the above registry keys have the same issue. They have duplicate permission entries for the same users and groups. One entry inherited from the branch above and the other was "non inherited" . To fix this I deleted all entries with "non inherited" and selected "Replace permissions..." to populate the changes to the whole branch.

If after all this you still get similar errors. Click on the link to the log file and search for "InvalidOperation".

When you find the error line, browse couple of lines above and look for "The name of the registry to be secured...". This will give you the registry key with corrupted permissions. Fix it and try again.


Wednesday, September 20, 2006

Johnathan Goodyear of ASPSoft talks about MasterPages in ASP.NET v2.0

Tonight at the SCDNUG meeting Jon Goodyear from ASPSoft gave an excellent demo on some tricks with MasterPages. The examples were original and useful. If you use or are about to use MasterPages in your projects I highly recommend this presentation/demo. Jon will be speaking next in Orlando, Thursday October 26, 2006 7:00 PM. For more information visit ONETUG. Dovizhdane!

Monday, September 18, 2006

Deploying SharePoint WebParts in development environment.

Developing SharePoint WebParts with generic controls is a straight forward task. For such WebParts we can always use a development Web site in our Visual Studio environment to work on the details and then deploy the control to WSS. With complex WepParts using specific WSS features this is not the case. The control has to be deployed to the WSS server after each and every change. Once you register the control in web.cofig and in your Web site (for more information click here), I found it very convenient to deploy the WebPart directly to the _app_bin folder of the Web site. This would work fine only if IIS did not lock your DLL. To work around this I created a Pre-build and Post-build tasks in the VisualStudio project file. Place the script files in your project folder and specify the server name. StopAppPool.vbs
strComputer = "[server name]" Set objIIS = GetObject _ ("IIS://" & strComputer & "/W3SVC/AppPools/SharePoint (80)") objIIS.Stop
strComputer = "[server name]" Set objIIS = GetObject _ ("IIS://" & strComputer & "/W3SVC/AppPools/SharePoint (80)") objIIS.Start

Both tasks execute VBScript that stops and then starts the application pool of the Web site once the newly built DLL is copied over and your developer life gets a bit simpler. Dovizhdane!

Sunday, September 17, 2006

Using Subversion in Windows development environment

Recently I was asked to research the features of Subversion as a replacement of MS SourceSafe. At the time Subversion sounded Chinese to me, but I kept an open mind and knowing some of the limitations of SourceSafe started looking into this open source SCM. And what a great surprise it was. The product has excellent features, it is very scalable and it is documented very well. In addition the pool of community uploads about it is growing as we speak. The main issue with many open source projects however is that to build a system, which meets your criteria, you need to solve a little puzzle of other software modules, script run-times and UI interfaces. The first one for Subversion is how to run the application: as a share, in server mode or as Web server with Apache. In addition it is important to try out most of the less known modules and determine which one fits your personal and team preferences best. After a week or two of playing around I prepared a short presentation for my team at Global 360. To address some of their comments and suggestions I created windows based migration tool (instead of using some of the available scripts), which proved to be very useful. Some of the main issues I address are: - Creating a process that consistently migrates VSS to SVN - Preserving file and folder history with accurate date/time - Creating an incremental export feature from VSS to SVN - Creating VSS shared files pre processing, for easier transformation of this feature not available in SubVersion. At the same time my colleagues from SCDNUG were looking for meeting topics, which are both engaging for the .Net developers, but not necessarily a Microsoft marketing effort. I immediately decided to put together my notes into a short presentation/tutorial. The goal is "to install Subversion in server mode with authentication and Windows integration within YY minutes". The value in this tutorial is that it concentrates specifically on Windows environment and creating a full featured development environment with automated build based on Subversion in short time. For those of you in the Space Coast area the SCDNUG meeting is at the Space Coast Credit Union Headquarters. Wednesday, November 15, 2006 6:00 PM - 8:00 PM Everybody else interested in this material will be able to download it from this blog soon. Dovizhdane!