The task could not be completed because "sgen.exe" was not found

I get the following error when trying to create my project in Visual Studio 2008 Professional Edition:

The task could not be completed because "sgen.exe" was not found or the correct Microsoft Windows SDK was not installed. The task searches for "sgen.exe" in the "bin" subdirectory under the location specified in the InstallationFolder value of the HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Microsoft SDK \ Windows \ v6.0A registry key. You can solve the problem by doing one of the following:

  • Install the Microsoft Windows SDK for Windows Server 2008 and the .NET Framework 3.5.
  • Install Visual Studio 2008.
  • Manually install the specified registry key in the right place.
  • Pass the correct location to the "ToolPath" parameter of the task.

I tried downloading the Microsoft Windows SDK for Windows Server 2008 and the .NET Framework 3.5 and still getting the error. I also tried to download the Windows 7 SDK and .NET Framework 3.5 and all the same result.

I also tried to manually modify the registry to modify the InstallationFolder, and I tried to restore the installation of Visual Studio.

The project was originally created in Windows XP, and I'm trying to compile it on a reformatted machine running Windows 7 Enterprise.

+4
source share
6 answers

The problem is with Visual Studio 2008 when using web links. I ended up removing web links and just used service links.

I found a blog post about this posted here and here .

+1
source

copy / y "C: \ Program Files \ Microsoft Visual Studio 8 \ SDK \ v2.0 \ Bin \ sgen.exe" "C: \ WINDOWS \ Microsoft.NET \ Framework \ v3.5 \"

See explanation here :

+7
source

This worked for me on Win 7 / VS.NET 2008:

Solution: Download the Windows SDK and install .Net Development Tools (it says 2008 Server, but I did it on XP SP3): http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=e6e1c3df-a74f- 4207-8586-711ebe331cdc

I found here a message that contains a useful screenshot of the minimum SDK installation needed to fix this.

+3
source

In Visual Studio, open the project settings property, then select the "Assembly" tab on the left. Select All Configurations from the Configuration drop-down list. Then go to the end of the panel and select "Off." From the Generate Serialization drop-down menu.

http://support.microsoft.com/kb/955715

+3
source

In Win Server 2008 and a new installation of VS 2008 with a project originally created in VS2003 with a web link, the comment on the Todd Price page associated with it worked for me. In the project properties during the build process, change the configuration to "All configurations" and change "Generate serialization assembly" to "Off."

0
source

In many cases, you will find that C: \ Program Files \ Microsoft Visual Studio 8 \ SDK \ v2.0 \ Bin \ is empty. in this case you will either have to install Visual Studio or SDK 2.0

When ordering the above time process, you can simply download sgen.exe from this and paste it into the folder "C: \ WINDOWS \ Microsoft.NET \ Framework \ v3.5 \".

It suited me perfectly! Hope this helps

0
source

All Articles