I've covered the setting up of a SharePoint development machine in the past but I thought I might just add a few notes on setting it up on the new Windows Server 2008.

The main difference you'll notice is in the configuration of IIS7. You will need to enable the correct set of features before installing anthing else. You will install the tools in a specific order. The VM I built is a Workgroup machine for development and learning at home, so I can get away with using my MACHINENAME\Administrator account for everything. I am using VMWare Workstation version 6. I use NAT to access the Internet via my host machine.

SharePoint Server 2007 on IIS7


When installing SQL Server 2005, you can ignore VS 2005-related compatibility errors. However, there is one serious gotcha: you must install the KB 950636 hotfix before installing SQL Server 2005 (only applies to Web Server Edition). If you do not do this, the install will not work on Windows Server 2008. For more details, check Bill Staples' IIS blog.

I created a base VM with just the OS and latest patches. I configured IIS7 and relaxed the browser security settings. I set a maximum size for the VM to grow to dynamically and configured it in 2GB chunks. Then I defragged and ran the VMWare shrink.

At this point, I created a full clone on which I installed the following, in this order:

KB 950636
* SQL Server 2005
* SQL Server 2005 SP2
* Windows Updates
* VS 2008
* Windows Updates
* Office 2007 Enterprise
* Windows Updates

Finally, install SharePoint Server 2007 with SP1 and you should be good to go :-)


VS 2008 on Vista 64-Bit

by agrace 3. August 2008 19:58

Vista Desktop Carousel I've been uncharacteristically quiet lately but kept busy with the creation of a new County SharePoint Intranet. I've also been busy on the home front, building up a new development machine which is the topic of this posting.

Although I have been working with VMs for the last year or so, and find them amazingly powerful to work with, a couple of things contributed to ongoing hirsutical challenges. Firstly, external drives simply don't cut it performance-wise and secondly, you really need ample RAM, storage and raw horsepower to develop SharePoint on VM's and still carry out normal development on the host machine in Visual Studio. At work, my problem was solved by an investment in VM servers and a SAN. At home, I felt like the Slowsky snail in the Comcast ad :-S

I upgraded from an XP Pro machine with 2MB of Ram, half of which was added a few months back, to a new HP D5000t 64-bit PC with a Quad Q9450 2.66 GHz processor, 8 GB of RAM and a 500GB SATA drive. I've hooked up a 500GB external Western Digital drive, mainly for back-ups and graphics storage. And I have purchased an extra internal SATA Seagate 750GB drive which I will use for all my VM work. More than anything, I wanted to work with VS 2008 on my host PC and this was the main carrot on the stick for upgrading.

Here are a few things to remember if you are moving to VS 2008 on Vista:

1) You need to get a version above Vista Home or Home Premium, such as Vista Ultimate, if you want IIS7 to play nice. This is reminiscent of having to use XP Pro over XP Home with IIS 5.0. If you try to install SQL Server 2005 on anything less than Ultimate you will start getting install errors relating to missing IIS7 features. Ultimate is $319 off the shelf so it's cheaper to include the upgrade when purchasing the PC.

2) Add the required components to IIS7 by going to Control Panel, Programs and Features, and clicking on "Turn Windows features on or off" on the left of the screen. See here and here for more details.

3) Your development tools have to be installed in this order: SQL Server 2005, SQL Server 2005 SP2 service pack, and finally VS 2008. Do not open anything in SQL Server 2005 before the service pack is installed. If you do not follow this order of install, you will have real problems installing the SQL Server Management Studio (SSMS) IDE. After VS 2008 is installed open it once to initialize it before checking for any Windows updates.

4) When installing SQL Server 2005, you may start getting compatibility errors; ignore these. After everything is installed you may notice some errors in your event log like this code 10 error:

"Event filter with query "SELECT * FROM __InstanceModificationEvent WITHIN 60 WHERE TargetInstance ISA "Win32_Processor" AND TargetInstance.LoadPercentage > 99" could not be reactivated in namespace "//./root/CIMV2" because of error 0x80041003. Events cannot be delivered through this filter until the problem is corrected."

KB 950375 contains a script to easily resolve this.


It was pretty painless to grab one of my existing 2.0 Web application projects from back-up and get it to work in VS 2008, using the multi-targeting feature.

Database Publishing Wizard 2.0


One of the lesser-known VS 2008 gems is the built-in Database Publishing Wizard 2.0. While developing with VS 2005 / SQL Server 2005, I have always used the standalone Database Publishing Wizard 1.1 to deploy SQL Server databases to production. It was a bit hacky but worked very well for a long time. Now the new wizard is built in and can be accessed in Server Explorer. Just add a connection, right-click it and select "Publish to Provider". You can use this to deploy complete databases both ways between a hosted server and your local IDE.... very nice :-)


PayPal Subscriptions Recently, I blogged about a PayPal Subscriptions project I was working on. This was a website where people could subscribe via PayPal for weekly religious lessons under one of three user categories. The previous post looked at the differences between the Web Site and Web Application Project models and what this meant when attempting to implement user profiles in conjunction with the membership system. Since I had previously created a few basic E-Commerce websites with regular Buy-Now buttons, I thought this would be a breeze... wrong :-|

As part of the project requirements, there would be separate, weekly messages displayed to the subscribers. The first message of a yearly subscription that would be displayed, would be tied to the original subscription date. No matter what kind of subscription system or periodical you are publishing, at some stage you will need to offer the correct issue number to a given subscriber. Since everyone will be subscribing at different times, this means keeping count! I decided to keep a tab of the week numbers. Bear in mind, that week calculations are done differently in different cultures and there is not a bug if you see week number 53!

using System.Globalization;

CultureInfo cultInfo = CultureInfo.CurrentCulture;
int weekNumNow = cultInfo.Calendar.GetWeekOfYear(DateTime.Now,


For the task in hand, I used ASP.NET 2.0 and C# with VS 2005 and SQL Server 2005. It was built as a Web Application Project, which meant using the Web Profile Builder wrapper class to enable access to user profiles. I've heard of several people getting errors with this but it worked for me out of the box. I'm inclined to think that some may have overlooked a particular section of the documentation which I am going to repeat here:

"When your project has reloaded, you need to generate the web profile class and manually include it in your project. Use the solution explorer to do this. In the solution explorer, choose the “Show All Files” option and press the “Refresh” button two times. The first time will generate the profile class and WebProfileBuilder.user file. The second time will actually show the files now that they exist. To include the generated profile class, right-click on the generated profile class and choose “Include In Project”. Now you will be able to write code against the profile class."

The rest is pretty straightforward:

Web.Config Profile Section


public partial class MyClass : System.Web.UI.Page
    private WebProfile Profile
            return new WebProfile(Context.Profile);

    protected void Page_Load(object sender, EventArgs e)
        string subscriberID = Profile.subscriberID;
        string subscriberGroup = Profile.subscriberGroup;


Of course, the glue that holds the entire application together is the IPN class. I had previously used the freely-available IPN class from XDev Software. Note that this class is designed for regular PayPal transactions. I had to customize it to handle PayPal subscriptions. All you really have to do is pare it down to handle only the subscription-related variables you are handling on the return handshake from PayPal. The following set of return variables worked for my particular scenario; you will set these as properties of your custom IPN class:

        string txn_type;
        string business;
        string item_name;
        string payment_gross;
        string payment_status;
        string receiver_email;
        string payer_email;
        string pending_reason;
        string payment_date;
        string subscribe_id;
        string first_name;
        string last_name;
        string custom;


Here's an overview of a typical subscription Web application life-cycle:

1) User subscribes on your site and is directed to the PayPal site where they pay
2) Your IPN class handshakes with PayPal and grabs the values returned by PayPal
3) Your IPN class updates your application database and generates an email to the subscriber with a return URL to register on your site
4) Your IPN class generates an email (backup) to the merchant with the subscription data
5) The subscriber creates a user account on your site and you set up any extra member info you want to store in their profile

protected void Createuserwizard1_CreatingUser(object sender, EventArgs e)
    WebProfile p = WebProfile.GetProfile(CreateUserWizard1.UserName, true);
    p.Initialize(CreateUserWizard1.UserName, true);
    p.subscriberID = ViewState["SubscriberID"].ToString();
    p.subscriberGroup = ViewState["Group"].ToString();


Some Gotchas:

Do not use a return URL from PayPal
Do not mix IPN and PDT. IPN is all you need
Do not forget the Save() method when creating the profile :-S