1

I have a solution that currently compiles successfully in Visual Studio.

I'm trying to get the solution to build via my build script, which is a C# console application that calls BuildManager.DefaultBuildManager.Build() to build the solution.

However, I get an exception:

_CheckForInvalidConfigurationAndPlatform

Here is the relevant code that runs the build code:

Dictionary<string, string> globalProperties = new Dictionary<string, 

string>()
{
    { "Configuration", "Debug" },
    { "Platform", "Any CPU" },
};
BuildRequestData buildRequest = new BuildRequestData(projectPath, globalProperties, null, new string[] { "Rebuild" }, null);
BuildResult buildResult = BuildManager.DefaultBuildManager.Build(buildParameters, buildRequest);

I am confident that the projectPath referenced here is correct (I logged it earlier).

Other relevant information is that this script used to work with an older version of Microsoft.Build (14.0 I think), but now that I updated, it is broken.

Brent
  • 209
  • 1
  • 11

0 Answers0