0
votes

I have multiple projects in my solution - C++ with x86 and x64 platforms and C# with Any CPU (third party dlls), x86 and x64 platforms. This projects depend on each other. I have two solution configurations - x86 and x64. When I select x86 in VS then all C++ projects are built as x86, all third party C# projects are built as Any CPU and my C# project is built as x86. x64 yields x64 for my projects and Any CPU for third party C# projects. This works within Visual Studio. However when I try to build this through MSBuild (AppVeyor CI) I get this error:

C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets (723,5): error : The OutputPath property is not set for project 'Atf.Core.vs201 0.csproj'. Please check to make sure that you have specified a valid combinati on of Configuration and Platform for this project. Configuration='Debug' Plat form='x86'. You may be seeing this message because you are trying to build a p roject without a solution file, and have specified a non-default Configuration or Platform that doesn't exist for this project. [D:\Engine\Code\Dependenc ies\ATF\Framework\Atf.Core\Atf.Core.vs2010.csproj]

It looks like MSBuild doesn't take into account solution's platforms. It tries to build every project within the solution with specified platform. I've tried to solve that adding /p:OutputPath=bin\Debug to MSBuild script, while x86 was compiled successfully, x64 gave me a lot of new errors :(

So my question. Is it possible to force MSBuild to fetch platform from solution mapping, instead of trying to use them per project as is?

P.S. I am using Premake to generate my projects, so it may be tricky to add some properties to the solution. Plus I'd like to avoid "fixing" the third party projects.

1
Have you tried to specify the platform and configuration MSBuild SolutionName.sln /property:Configuration=Release /property:Platform=x64?Sergii Zhevzhyk
Yes, that's how I try to build my project locally. And it gives me the error mentioned in the first postStiX

1 Answers

0
votes

The only solution I have found for this problem is to follow the following rules in my solutions:

  • Create a unique platform name for all projects, like "Intel", "UniquePlatform" or "RogerRabbit".
  • Select the right set of parameters for each project.
  • Remove all other platforms for all projects.
  • Never include third-party sources into my solution if I don't intend to "fix" them. I author a nuget package on a local feed if needed.

Then, I can build with msbuild, and there are less unused (unused because devoid of sense) Platform/Configuration combinations.