all posts

CC.NET & MSBuild error sgen.exe was not found

Published to Blog on 22 Aug 2006

I’ve run into this issue twice now and since I had to look it up again the second time (because I can’t remember crap anymore), I thought I would post it here.

Task failed because “sgen.exe” was not found, or the .NET Framework SDK v2.0 is not installed. The task is looking for “sgen.exe” in the “bin” subdirectory beneath the location specified in the SDKInstallRootv2.0 value of the registry key HKEY\LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework. You may be able to solve the problem by doing one of the following: 1.) Install the .NET Framework SDK v2.0. 2.) Manually set the above registry key to the correct location. 3.) Pass the correct location into the “ToolPath” parameter of the task.

_So what is the deal?  When installed VS.NET also installs the Framework SDK. Our build server has the Framework installed on it of course, but it does not have VS.NET installed on it and the Framework SDK was never installed on separately. For the most part our builds are normal web site builds, don’t really use SGEN or SN or anything else like that. But one of the apps that I set up this morning had a project that uses SGEN. The build threw the above error message because the Framework SDK was not installed.

The fix: download and install the Framework SDK.

Technorati Tags: CruiseControl.NET MSBuild SGEN.exe


Dan Hounshell
Web geek, nerd, amateur maker. Likes: apis, node, motorcycles, sports, chickens, watches, food, Nashville, Savannah, Cincinnati and family.
Dan Hounshell on Twitter


  • On 19 Mar 2007 "Oliver"" said:
    What if I already installed the framework SDK and still get that error?
  • On 20 Mar 2007 """ said:
    Oliver, check to make sure that folder for the Framework SDK (specifically the folder that SGEN.exe is in) is in your path.
  • On 4 Feb 2008 "Task failed because "sgen.exe" was not found solution « &8230;meie igap??evast IT&8217;d anna meile igap??ev&"" said:
    PingBack from http//dukelupus.wordpress.com/2008/02/05/task-failed-because-sgenexe-was-not-found-solution/
  • On 17 Feb 2008 "David White"" said:
    Windows Server 2008SDK is the only way to get .NET Framework SDK as they are bundled together in a 1.1GB download. Currently it is RC0 and beta2, respectively. Thus, I went for the "shortcut" approach, and just installed sgen.exe from my dev machine onto the CI machine, and added the registry key to suit. That has eliminated the error.
  • On 13 Mar 2008 "Jack"" said:
    See comments here http//dukelupus.wordpress.com/2008/02/05/task-failed-because-sgenexe-was-not-found-solution/