开发者

Build VS2010 solution using MSBuild 2008

Our dev team recently upgraded solution to VS2010 from VS2008 to use some of the features from VS2010 IDE. But our targeted framework is still .Net 3.5. When dev runs the MSBuild from VS 2008 command prompt to build VS2010 solution, build was successful. 开发者_如何学Gobut on build server we are getting the below error.

MSB3086: Task could not find "sgen.exe" using the SdkToolsPath "" or the registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A". Make sure the SdkToolsPath is set and the tool exists in the correct processor specific location under the SdkToolsPath and that the Microsoft Windows SDK is installed in Microsoft.Common.targets(2249, 9)

We don't have either VS2010 or Windows SDK 7.1 or .Net 4.0 on the build server. Also we don't want to install .Net 4.0 or VS2010 on build server since we want to continue with .Net 3.5 in production.

Is there any way to fix running the VS2010 solution using VS 2008/3.5 MSBuild with out installing .Net 4.0 or VS2010 on build server?

Thanks Todd


If you are using VS2010 for development then you should install .NET 4.0 (MSBuild 4.0) at a minimum on your build server. Your projects can still target .NET 3.5. I would not entertain the idea of trying to get MSBuild 3.5 to build a VS2010 solution file. Just use MSBuild 4.0 and target .NET 3.5.


One method that might work, depending on whether you're using .Net 4.0 language features, would be to use Steve Dunn's SwitchVsVersion as part of the build process on the build server to change the Visual Studio version of the solution file to 2008.

usage:

SwitchVsVersion.exe <target dir> 2008

changes the version of the sln and csproj files in <target dir> to be Visual Studio 2008 compatible

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜