How can you access the Visual Studio solution level platform from a C# project's build event?

后端 未结 5 1923
既然无缘
既然无缘 2020-12-11 02:07

We have a large VS 2010 solution that is mostly C# code but there are a few native DLLs that various C# projects depend upon (including our unit testing DLL). We\'re in the

5条回答
  •  爱一瞬间的悲伤
    2020-12-11 02:23

    I've not used it myself, but Build -> Batch Build is probably what you want. With it you can build multiple platforms.

    http://msdn.microsoft.com/en-us/library/169az28z.aspx

    Of course, this doesn't actually enable you to access the 'platform' for the solution, but you don't need to since you'll build each platform separately.

    Update: If you want to automate the build, create a batch file with the following contents

    "c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv" ../solution.sln /rebuild "platform"
    

    where 'platform' is "Release|Any CPU", "Release|x86" etc. and repeat the line for each configuration you need to build. Use the Configuration Manager to set up each project for a a build for x86 and x64 and you should have what you want.

提交回复
热议问题