Use MSBuild 3.5 with Visual Studio 2010

后端 未结 3 419
误落风尘
误落风尘 2021-01-12 00:32

How can I force Visual Studio 2010 to use MSBuild 3.5 instead of the new 4.0 ?

3条回答
  •  一向
    一向 (楼主)
    2021-01-12 00:47

    Why do you want that? Is there anything 3.5 capable but 4.0 not?

    If your real concern is that when the code is checked out to a machine that does not have .NET 4 installed, you can use MSBuild 3.5 to build the projects (csproj). You need to create a solution file for MSBuild 3.5 as it does not accept the sln file of VS2010.

    When MSBuild comes across ToolsVersion="4.0" it will treat it as ToolsVersion="3.5" and then everything continues to work.

    My open source project #SNMP utilizes such tricks so the source code can be built on .NET 4, .NET 3.5 and Mono.

提交回复
热议问题