I had a similar problem with the same error message, and after many disappointments a solution was found (which, I hope, will give some ideas for this).
Here we have a build server with Windows SDK 7.1 (and with 6.1 when using Vs 2008), creating VS 2010 projects targeting .NET 3.5. Web projects are then precompiled using aspnet_compiler (from v2 at http://msdn.microsoft.com/en-us/library/ms229863.aspx#findingthecorrectversion ). During the pre-compilation, I received the same error message as you, for a project (not a web, just a regular library) with a web link to a web service. It appears that the Windows SDK 7.1 incorrectly configured the registry paths to use the .NET 3.5 tools (while Visual Studio does this). This led to the fact that the web links were compiled with the target .NET 4 environment (using a reflector), so aspnet_compiler v2 had a fit. I compared the build server registry settings with my local visual studio, which showed that the .NET 3.5 configuration for SDK 7.1 was not good, so I fixed the build server with the following. I assume that the xml web link (in a non-web project) was precompiled with sgen for .NET 4 as a rollback for misusing .NET 3.5 sgen. As soon as the registry change was applied, everything was in order (the assembly server was not in my registry below, so I created it).
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.1\WinSDK-NetFx35Tools-x86] "ComponentName"="Windows SDK .NET Framework 3.5 Multi-targeting Utilities" "InstallationFolder"="C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1\\bin\\" "ProductVersion"="7.1.7600.0.30514"
As an additional note, I also used WindowsSdkVer to install 7.1 as the default SDK.
source share