toppless
toppless

Reputation: 411

Visual Studio 2013 and MSBuild command line switches

Is there a way to specify msbuild switches like /p:option=value within Visual Studio 2013?

Upvotes: 1

Views: 1080

Answers (1)

Amnon Shochot
Amnon Shochot

Reputation: 9356

Formalizing my comment from above.

A possible solution may be to have a targets file (e.g. VisualStudioOverrides.targets) that defines the properties to be overridden and their values. Then, if this file exists then the csproj file will import it, thus override the relevant properties. Such an import statement should be placed at the bottom of the csproj file (after the properties to be overridden were defined) and would look something like:

<Import Project="$(MSBuildProjectDirectory)\VisualStudioOverrides.targets" Condition="Exists('$(MSBuildProjectDirectory)\VisualStudioOverrides.targets')" />

Upvotes: 1

Related Questions