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 :-)

kick it on DotNetKicks.com   PHP, ASP, .NET, JSP Resources, Reviews   vote it on Web Development Community

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

kick it on DotNetKicks.com   PHP, ASP, .NET, JSP Resources, Reviews

HTML Markup I don't know about you, but as a Web Developer I sometimes find myself not doing the things I should be doing. The recent rash of SQL Injection script attacks have shown me personally how little thought I sometimes give to where the input is coming from when I'm developing forms.

Then there is the generated markup itself. All our development efforts end up in plain HTML being spit out onto a'page' on a device of some kind. When you consider how sensitive the search bots are to the structure, content and placement of our markup, isn't it amazing that the only time we ever think of it is when we have to generate it dynamically in some code-behind? :-O

If you are using master pages, then you won't want to have duplicate content, in the shape of similar meta tag content, all over your site. So, you will have to generate the meta tags programmatically in the code-behind of the content pages:

HtmlHead head = this.Master.Page.Header;
HtmlMeta meta = new HtmlMeta();
meta.Name = "Description";
meta.Content = "Friendly and relevant content";

You also do not want pages in the secure area of your site to be spidered:

HtmlHead head = this.Master.Page.Header;
HtmlMeta meta = new HtmlMeta();
meta.Name = "googlebot";
meta.Content = "noindex, nofollow";

I recently noticed a big chunk of JavaScript in the markup that I was using to solve the problem of pushing the footer to the bottom of the page, and not relying on copious amounts of needless content and spacers to do the job that CSS cannot. I should have had it in an external file and used the appropiate ASP.NET method to register it and pull it in. So, I created a JS file called footerFix.js, placed it in its own folder and used the following in the master page code-behind:

string myScript = "/js/footerFix.js";
Page.ClientScript.RegisterClientScriptInclude("myKey", myScript);

This created the following markup in my page:

<script src="/js/footerFix.js" type="text/javascript"></script>

Now I have a smaller page, faster download time and a fairly good chance of the spiders actually getting the info they require.

kick it on DotNetKicks.com   PHP, ASP, .NET, JSP Resources, Reviews