In MSBuild is it possible to determine if I'm running in Visual Studio

后端 未结 4 1293
情话喂你
情话喂你 2021-02-05 01:36

Are the any MSBuild properties that Visual Studio sets? I\'m looking to have some conditional behavior depending on the version (if any) of visual studio.

4条回答
  •  遇见更好的自我
    2021-02-05 02:32

    will give you the version of MSBuild that is running the build process.

    Note that in VS 2010 the build process might be targeting either .Net 4.0 or 3.5 You need to consider carefully if your conditional compilation depends on the msbuild version itself or on the target framework of the build and the tools the build is using. If your condition is based on the target framework, use .

    Of course, if your build also might be run under VS 2008, you need to support proper fallback if is missing.

提交回复
热议问题