MSBuild error “C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(1993,9): error MSB3091: Task failed because “sgen.exe” was not found, or the correct Microsoft Windows SDK is not installed. The task is looking for “sgen.exe” in the “bin” subdirectory beneath the location specified in the InstallationFolder value of the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v6.0A. You may be able to solve the problem by doing one of the following: 1) Install the Microsoft Windows SDK for Windows Server 2008 and .NET Framework 3.5. 2) Install Visual Studio 2008. 3) Manually set the above registry key to the correct location. 4) Pass the correct location into the “ToolPath” parameter of the task.”

04/08/2009

I fought for a couple of minutes with this error and I thought to share with you my solution.

The error was on my build machine which wasn’t having Windows SDK and I wasn’t planning to install it either.

I was having HKLM\SOFTWARE\Microsoft\Microsoft SDKs\.NETFramework\v2.0 key and the InstallationFolder key with the value C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\ so I thought about adding the key that was normally generated by Windows SDK.

So, I added HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v6.0A key with the InstallationFolder key pointing to the same value as above and copied the missing sgen.exe into the bin\ folder under the above mention location.

I queued a new build a everything worked like a charm.

I hope this helps,
Bogdan

Advertisements

Summary 07.05.2009

07/05/2009

ASP.NET MVC

CoNatural continue their series on asynchronous search with ASP.NET MVC and JQuery.

Phil has an excellent article about another hidden gem of ASP.NET that allows us to mingle with the page parsing process: PageParseFilter.

Scott Allen show how to build a custom model binder and what are the different issues the arise in different implementations.

Maarten Balliauw adds to the previous list of best practices his very own.

David Hayden has a nice article about working with custom ControllerActionInvoker and overriding CreateActionResult() in order to return JSON results.

Visual Studio 2010

The WebDev Team just published a great article on how we can have a web.config file for each staging environment based on the new transformation features available in Visual Studio 2010.

Channel 9 has another webcast on functional UI testing.

CLR

For a deep dive into ThreadAbortException and how to make it stop using catch clause and Thread.ResetAbort(), go check the CLR Team’s post!

Eric Lippert has another great article that explains that value types being stored on the stack is just an optimization detail performed by the CLR.

C#

Eric Lippert explains how events are raised properly and what are the risks involved with using them inappropriately.

Architecture

Vittorio has another great article about claims and how they work.

Debugging

The Microsoft Support Team has a very cool article about debugging ASP.NET requests at runtime in IIS 6.0.

ASP.NET AJAX 4.0

Bertrand Le Roy has another great tip on how to use JQuery to instantiate Microsoft AJAX components.

Methodologies

The SRLTeam has a great post about bug management.

TDD

Simon Segal has a great post about mocking Entity Framework repositories with Moq.

Team Foundation Server

If you are looking for customizing different aspects of TFS, keep an eye on this blog as it very useful information. Currently they have a nice series of posts on work item customization.

Enterprise Library

Grigori Melnik has some greats news about EntLibContrib: a new release is available (based on the EL 3.1 core) and the future plans include upgrade to the core of EL 4.1.

kick it on DotNetKicks.com


Solution file error MSB5009: Error parsing the nested project section in solution file.

28/04/2009

After merging the solution file while getting the latest version and checking back in, the TFS automatic build triggered by the check-in failed.

The solution was quite simple:

  1. I added a dummy file to the solution and checked-in the solution with the new dummy file.
  2. I had a successful automatic build.
  3. I removed the dummy file and checked-in again the solution without the dummy file.
  4. I had another successful automatic build.

I hope this will help others too!