删除ASP.NET Core项目上默认的Debug构建配置

在ASP.NET Core 3.1应用程序CSProj文件中,我具有以下内容:

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

因此,我设置了一个“开发”构建配置,该配置基本上是调试配置。

当我仅使用dotnet build时,该项目是使用Debug配置构建的。

要使用开发配置,我需要使用dotnet build -c development

是否可以将development配置设置为默认配置,以便由以下人员使用:

dotnet构建

pl3000 回答:删除ASP.NET Core项目上默认的Debug构建配置

在大多数csproj文件中,您会看到将变量分配给默认值,如下所示:

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

我认为在您的情况下,您需要这样的东西:

<PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">development</Configuration>
</PropertyGroup>
本文链接:https://www.f2er.com/2977080.html

大家都在问