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




Cool Dude Programmer I have just begun working on an application, a website which offers people paid subscriptions via PayPal to a weekly message, which they can view on the site after logging in. I had the site designed, including the CSS and two separate master pages. The site was up on staging as an ASP.NET 2.0 Web Application Project written in C#, and I had just started looking to the required functionality when I got an unexpected lesson in the differences between the two ASP.NET development models; that is, the "Web Site" and the "Web Application Project" models.

Quick note on naming conventions: I always use the single-word version, "website"; personal choice. Microsoft refers to the ASP.NET template as "Web Site", as in FILE -> New Web Site. Still, if you look at the Drop Down Menu names in Visual Studio after opting to go with a "Web Site", you will see "Website". Worse still, try googling this! Consistency aside, this is one dumb-ass naming choice which is right up there with MOSS "Features", another joy to Google... end of rant ;-)

I normally use the Web Application Project model because it is what I am used to and it makes sense to me. I have always viewed the Web Site model as something to use for demonstration purposes and the like. Truthfully, when Microsoft initially brought out only the Web Site template with VS 2005 and then did the turnaround to also include the Web Application Project template in SP1, I believe that at this point they should have dropped the Web Site model completely. To this day, it leads to nothing but confusion among developers of all levels.

The differences between the two models have been pretty well covered, or at least so I thought. This article is not going to delve into the details of these templates, so for the benefit of those new to ASP.NET, here are some informative references on the two models:

* Comparing Web Site Projects and Web Application Projects
* Visual Studio 2005 Web Application Project Option
* ASP.NET 2.0 - Web Site vs Web Application
* Converting a Web Site Project to a Web Application Project
* Add a Reference to a Visual Studio Project in a Web Site

 With a two-week deadline, I wanted as much out-of-the-box functionality as I could leverage from ASP.NET.

Surprise #1: Profiles only Work Out-of-the-Box with the Web Site Template
In order to implement the logic for the application described above, I planned on using User Profiles to store some extra information for each subscriber such as the date they subscribed along with the type of subscription. Profiles allow you to store some extra information per user when using the ASP.NET membership system. In this case, I was using SQL Server 2005 to store membership details. Profiles are stored in the database automatically and all we have to do is add this extra information to our web.config file. We don't need to know anything about how this data is stored or retrieved.

What they don't tell you is that Profiles only work out-of-the-box with the Web Site option. I discovered this while reading the comments on Scott Guthrie's great blog posting on this topic. There is a workaround available and you can find out more about that here. The problem stems from the fact the Web Application Project does not have the Profile object automatically added to each page as with the Web Site project, so we cannot get strongly-typed programmatic access to the profile properties defined in our web.config file.

The Web Project workaround did not appeal to me because this is an E-Commerce site for a client and I did not like the idea of having to resort to an add-in. I had no way of knowing how stable this was or what other issues might have arisen within my short project time-frame. You can code your own custom profile class if you choose.

The real kicker here is that Profiles are still not available out-of-the-box with the VS 2008 ASP.NET 3.5 Web Application Project template. A mysterious omission...

Surprise #2: Where is the Web Content Form in the Web Site Project?
As already mentioned, I was using two separate master pages and every page in my site is based off one of these master pages. When I went to add a Web Content Form in the Web Site "project", there was none! At first I hand-coded the page tag, then I noticed the "Select master page" checkbox. The images below show the Web Content Form when using a Web Application Project and the lack of one when using the Web Site "Project".

Web Application Project - Web Content Form

 

Web Site Project - No Web Content Form

 

Surprise #3: Where have all the Namespaces Gone?
No namespaces are used for classes anywhere in the App_Code folder. Now, most of us already know that the application automagically finds classes placed in this folder. But, for someone like me who is so used to working with the project model, this didn't strike me right off the bat! So, presumably name conflicts are not a cause for concern here? This is confirmation that Microsoft never intended the Web Site "Project" template for enterprise work, if anyone was ever in any doubt.

My own project will have a user control which is referenced from a master page. On reading this post by Rick Strahl, I see that there are all kinds of difficulties when accessing user controls with the Web Site model - read through the comments. Now I'm thinking that I may revert to the Web Application Project and use the Web Profile Builder to solve my Profile issues after all! At least I won't have grapple with trying to dynamically load a user control from a different assembly... are you getting the bad code smell yet?

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




Silverlight 2 Beta 1 Solution I decided to get adventurous and see what all the fuss was about. So, I'm going to record my experiences as I try to "do something" with Silverlight! Fasten your seat belt and come on a drive-along. No guarantees. The sole aim here is to get a successful install of all the working parts. I know absolutely nothing about Silverlight so this will be truly ab-initio.

If I was slow to make the jump on this one, it was probably because I have had a hard time figuring out how the run-of-the-mill developer will suddenly become artistic overnight and vice-versa with designers suddenly spouting algorithms in their sleep. Microsoft's red-suspendered marketing brigade describe Silverlight as a "cross-browser, cross-platform plug-in for delivering next-generation media experiences and rich interactive applications for the Web." I'm starting to think that as far as Silverlight and some of the other emerging technologies from Redmond are concerned, we have not seen the big picture yet.

I already had VS 2008 installed on my VMWare Workstation and had just downloaded the .NET 3.5 Enhancements Training Kit, when I decided to go for broke with Silverlight. I navigated to the Silverlight Get Started page and worked from there. I wanted ALL the toys so here's the order in which I installed things:

    1) .NET 3.5 Enhancements Training Kit

    I was then prompted to install Windows Power Shell 1.0 and ASP.NET 3.5 Extensions.

    2) Silverlight Tools Beta 1 for Visual Studio 2008
    Includes Beta 1 runtime and SDK (thanks Ailon)...

    Follow Robert Cameron's advice on getting the SDK to show up in VS 2008.
    You can optionally download the source code and unit tests for some of the controls.

    3) Expression Blend 2.5 March 2008 Preview

    4) Expression Web 2 (391 MB)

Finally, download the Deep Zoom Composer. Check out the Hard Rock Memorabilia sample of Deep Zoom in action. 

Follow the steps here to create your first Silverlight project. Also, check out Jesse Liberty's Silverlight For Total Novices site for some more resources.

We haven't actually done anything with Silverlight yet but we're off to a good start. I'll be back soon, hopefully with something useful built!

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