donderdag 12 juni 2008

The pain of development in Vista

I recently bought a new laptop with Windows Vista already pre-installed.  Until that time my development machine was running on XP, but now I had the joy of meeting the latest invention (??) of Microsoft called User Access Control (UAC)!  I am still figuring out if this is supposed to be feature or a bug that the programmers could not fix. 

My problem is the following: Whenever I open a perfectly working solution on my new machine I got an annoying "System.Runtime.InteropServices.COMException" exception hitting me.  I quickly realized it happened only when accessing a Web or Service through IIS.  Whenever you want to access local IIS Website your Visual Studio needs to fired up in the context of an administrator, by default Vista starts applications in a limited-privilege user account.  The solution to this problems is relatively easy, always start your studio in administrator mode.  I created a new shortcut that runs in administrator mode and associated my sln-files to use this shortcut by default.  If you right-click on a shortcut, in the advanced tab you can select the 'run in administrator' option.

Problem solved if you can live with a UAC popup every time you open Visual Studio.  If you anything like me you want to avoid this popup as well :-), my first thought was simply disable the UAC Altogether, but then other features might stop working because windows believes your system is not trustworthy.  Since I usually select proceed in those useless popups I decided to accept this silently without prompting, you can read here how this can be achieved.  I took the liberty of giving you summary here:

Click Start and Control Panel. Switch to Classic View (if you haven't already) and click on the Administration Tools icon. In the list that opens click on Local Security Policy, and in the next window, Local Policies (a tiny bit redundant, but all UIs can't be perfect -- If UAC is running you'll get a UAC pop-up somewhere in here). In the Local Policies list click Security Options, and scroll down to "User Account Control: Behavior" (the full title of the policy is "User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode" but the window barely opens that far). Double-click the title and in the dialog box change its setting from "Prompt for Consent" to "Elevate without prompting." Click OK and the urge to tear your hair and scream at your PC will be greatly diminished in the future.

I hope this post will save you time and headache, till next time.

donderdag 5 juni 2008

NHibernate in Action: Book Review

I finished this 'beta' book today, it took me a while because I have the bad habit of reading multiple books at the same time.  For an NHibernate virgin like myself the book was a very good introduction. It covers everything you need to know to get started with release 1.2.1 version, although nothing is inserted (yet ?? ) for the upcoming 2.0 release.  I hope the final version will include some chapters covering the new features, especially the event/listener model seems to be interesting.  If it doesn't the book might already be outdated upon its release in August.

The thing I was missing was more in depth information about extending the functionality of NHibernate.  We had an issue for instance with the interceptors which you can read all about here, but the book did not provide a lot of information about. 

My overall conclusion is positive because it was a nice intro, but if you already have some experience with NHibernate the book  might be too 'easy' for you.

woensdag 4 juni 2008

Big twitter is watching you.... or me

I finally got the 'stalking decease' as well and subscribed to twitter.  You can follow me here.