0

On an ASP.NET Core 3.1 application CSProj file I have the following:

<PropertyGroup Condition="'$(Configuration)' == 'development'">
  <ConfigurationGroup>Debug</ConfigurationGroup>
</PropertyGroup>

So I set a 'development' build configuration which is basically the debug configuration.

When I simply use dotnet build the project is built with Debug configuration.

To use the development configuration I need to use dotnet build -c development.

Is it possible to set development configuration as default so it is used by:

dotnet build

1 Answer 1

1

In most csproj files you see assignment of variables to a default value like this:

<PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
</PropertyGroup>

I think in your case you want something like this:

<PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">development</Configuration>
</PropertyGroup>
Sign up to request clarification or add additional context in comments.

1 Comment

That didn't work ... It seems the dotnet tool sends Debug for default so I need to use: <Configuration Condition="'$(Configuration)' == 'Debug'">development</Configuration>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.