简体   繁体   English

如何设置要考虑发布 ASP.NET Core 应用程序的 AS.NETCORE_ENVIRONMENT

[英]How to set ASPNETCORE_ENVIRONMENT to be considered for publishing an ASP.NET Core application

When I publish my ASP.NET Core web application to my local file system, it always takes the production-config and the AS.NETCORE_ENVIRONMENT variable with the value = "Production".当我将我的 ASP.NET Core web 应用程序发布到我的本地文件系统时,它始终采用 production-config 和值为“Production”的 AS.NETCORE_ENVIRONMENT 变量。

How and where do I have to set the value of the AS.NETCORE_ENVIRONMENT variable so that it will be considered not only for debugging, but also for the publishing ?我必须如何以及在何处设置 AS.NETCORE_ENVIRONMENT 变量的值,以便它不仅用于调试,而且用于发布 I already tried the following options without success:我已经尝试了以下选项但没有成功:

  • in windows settings在 windows 设置中
  • in file .pubxml file在文件.pubxml文件中
  • in file launchSettings.json在文件launchSettings.json
  • in file project.json在文件project.json

Other than the options mentioned above, there are a couple of other solutions.除了上面提到的选项,还有其他几个解决方案。

1. Modifying the project file (.CsProj) file 1.修改工程文件(.CsProj)文件

MSBuild supports the EnvironmentName property which can help to set the right environment variable as per the environment you wish to deploy. MSBuild 支持EnvironmentName属性,它可以帮助根据您希望部署的环境设置正确的环境变量。 The environment name would be added in the web.config during the publish phase.环境名称将在发布阶段添加到web.config中。

Simply open the project file (*.csProj) and add the following XML.只需打开项目文件 (*.csProj) 并添加以下 XML。

<!-- Custom property group added to add the environment name during publish

     The EnvironmentName property is used during the publish
     for the environment variable in web.config
-->
<PropertyGroup Condition=" '$(Configuration)' == '' Or '$(Configuration)' == 'Debug'">
  <EnvironmentName>Development</EnvironmentName>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' != '' AND '$(Configuration)' != 'Debug' ">
  <EnvironmentName>Production</EnvironmentName>
</PropertyGroup>

The above code would add the environment name as Development for a debug configuration or if no configuration is specified.上面的代码会将环境名称添加为Development用于调试配置或未指定配置。 For any other configuration, the environment name would be Production in the generated web.config file.对于任何其他配置,环境名称将是生成的web.config文件中的Production More details are here .更多细节在这里

2. Adding the EnvironmentName property in the publish profiles. 2. 在发布配置文件中添加 EnvironmentName 属性。

We can add the <EnvironmentName> property in the publish profile as well.我们也可以在发布配置文件中添加<EnvironmentName>属性。 Open the publish profile file which is located at Properties/PublishProfiles/{profilename.pubxml} .打开位于Properties/PublishProfiles/{profilename.pubxml}的发布配置文件。 This will set the environment name in web.config when the project is published.这将在项目发布时在web.config中设置环境名称。 More details are here .更多细节在这里

<PropertyGroup>
  <EnvironmentName>Development</EnvironmentName>
</PropertyGroup>

3. Command line options using dotnet publish 3. 使用dotnet publish的命令行选项

Additionally, we can pass the property EnvironmentName as a command-line option to the dotnet publish command.此外,我们可以将属性EnvironmentName作为命令行选项传递给dotnet publish命令。 The following command includes the environment variable as Development in the web.config file.以下命令将环境变量作为Development包含在web.config文件中。

dotnet publish -c Debug -r win-x64 /p:EnvironmentName=Development

Option1:选项1:

To set the ASPNETCORE_ENVIRONMENT environment variable in Windows:在 Windows 中设置 ASPNETCORE_ENVIRONMENT 环境变量:

  • Command line - setx ASPNETCORE_ENVIRONMENT "Development"命令行 - setx ASPNETCORE_ENVIRONMENT "Development"

  • PowerShell - $Env:ASPNETCORE_ENVIRONMENT = "Development" PowerShell - $Env:ASPNETCORE_ENVIRONMENT = "Development"

For other OSes, refer to Use multiple environments in ASP.NET Core对于其他操作系统,请参阅在 ASP.NET Core 中使用多个环境

Option 2:选项 2:

If you want to set ASPNETCORE_ENVIRONMENT using web.config then add aspNetCore like this -如果你想使用web.config设置 ASPNETCORE_ENVIRONMENT 然后像这样添加aspNetCore -

<configuration>
  <!--
    Configure your application settings in appsettings.json. Learn more at http://go.microsoft.com/fwlink/?LinkId=786380
  -->
  <system.webServer>
    <handlers>
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
    </handlers>
    <aspNetCore processPath=".\MyApplication.exe" arguments="" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false">
      <environmentVariables>
        <environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" />
      </environmentVariables>
    </aspNetCore>
  </system.webServer>
</configuration>

A simple way to set it in the Visual Studio IDE.在 Visual Studio IDE 中设置它的简单方法。

Menu ProjectPropertiesDebugEnvironment variables菜单项目属性调试环境变量

在此处输入图像描述

This is how we can set it at run time:这是我们可以在运行时设置它的方式:

public class Program
{
    public static void Main(string[] args)
    {
        Environment.SetEnvironmentVariable("ASPNETCORE_ENVIRONMENT", "Development");

        BuildWebHost(args).Run();
    }

    public static IWebHost BuildWebHost(string[] args) =>
        WebHost.CreateDefaultBuilder(args)
            .UseStartup<Startup>()
            .Build();
}
  1. Create your appsettings.*.json files.创建您的appsettings.*.json文件。 (Examples: appsettings.Development.json , appsettings.Staging.json , and appsettings.Production.json ) (示例: appsettings.Development.jsonappsettings.Staging.jsonappsettings.Production.json

  2. Add your variables to those files.将变量添加到这些文件中。

  3. Create a separate publish profile for each environment, like you normally would.像往常一样,为每个环境创建一个单独的发布配置文件。

  4. Open the PublishProfiles/Development.pubxml file (naming will be based on what you named the Publish Profile).打开PublishProfiles/Development.pubxml文件(命名将基于您命名的发布配置文件)。

  5. Simply add a tag to the PublishProfile to set the EnvironmentName variable, and the appsettings.*.json file naming convention does the rest.只需将标签添加到PublishProfile以设置EnvironmentName变量,剩下的工作由appsettings.*.json文件命名约定完成。

     <PropertyGroup> <EnvironmentName>Development</EnvironmentName> </PropertyGroup>

Reference: Visual Studio publish profiles (.pubxml) for ASP.NET Core app deployment参考: 用于 ASP.NET Core 应用部署的 Visual Studio 发布配置文件 (.pubxml)

Refer to the “Set the Environment” section.请参阅“设置环境”部分。

You should follow the instructions provided in the documentation , using the web.config .您应该按照文档中提供的说明使用web.config

<aspNetCore processPath="dotnet"
        arguments=".\MyApp.dll"
        stdoutLogEnabled="false"
        stdoutLogFile="\\?\%home%\LogFiles\aspnetcore-stdout">
  <environmentVariables>
    <environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Production" />
    <environmentVariable name="CONFIG_DIR" value="f:\application_config" />
  </environmentVariables>
</aspNetCore>

Note that you can also set other environment variables as well.请注意,您也可以设置其他环境变量。

The ASP.NET Core Module allows you specify environment variables for the process specified in the processPath attribute by specifying them in one or more environmentVariable child elements of an environmentVariables collection element under the aspNetCore element. ASP.NET Core 模块允许您为 processPath 属性中指定的进程指定环境变量,方法是在 aspNetCore 元素下的 environmentVariables 集合元素的一个或多个 environmentVariable 子元素中指定它们。 Environment variables set in this section take precedence over system environment variables for the process.本节中设置的环境变量优先于进程的系统环境变量。

This variable can be saved in JSON.这个变量可以保存在 JSON 中。 For example, envsettings.json with content as below例如,envsettings.json 内容如下

{
    // Possible string values reported below. When empty, it uses the ENV variable value or
    // Visual Studio setting.
    // - Production
    // - Staging
    // - Test
    // - Development

    "ASPNETCORE_ENVIRONMENT": "Development"
}

Later modify your program.cs file as below稍后修改您的program.cs文件,如下所示

public class Program
{
    public static IConfiguration Configuration { get; set; }
    public static void Main(string[] args)
    {
        var currentDirectoryPath = Directory.GetCurrentDirectory();
        var envSettingsPath = Path.Combine(currentDirectoryPath, "envsettings.json");
        var envSettings = JObject.Parse(File.ReadAllText(envSettingsPath));
        var environmentValue = envSettings["ASPNETCORE_ENVIRONMENT"].ToString();

        var builder = new ConfigurationBuilder()
               .SetBasePath(Directory.GetCurrentDirectory())
               .AddJsonFile("appsettings.json");

        Configuration = builder.Build();

        var webHostBuilder = new WebHostBuilder()
          .UseKestrel()
          .CaptureStartupErrors(true)
          .UseContentRoot(currentDirectoryPath)
          .UseIISIntegration()
          .UseStartup<Startup>();

        // If none is set it use Operative System hosting enviroment
        if (!string.IsNullOrWhiteSpace(environmentValue))
        {
            webHostBuilder.UseEnvironment(environmentValue);
        }

        var host = webHostBuilder.Build();

        host.Run();
    }
}

This way it will always be included in publish and you can change to the required value according to the environment where the website is hosted.这样,它将始终包含在发布中,您可以根据托管网站的环境更改为所需的值。

This method can also be used in a console application as the changes are in file Program.cs .此方法也可以在控制台应用程序中使用,因为更改位于文件Program.cs中。

With the latest version of the dotnet CLI (2.1.400 or greater), you can just set this MSBuild property $(EnvironmentName) and publish tooling will take care of adding ASPNETCORE_ENVIRONMENT to the web.config with the environment name.使用最新版本的dotnet CLI(2.1.400 或更高版本),您只需设置此 MSBuild 属性$(EnvironmentName) ,发布工具就会使用环境名称将 ASPNETCORE_ENVIRONMENT 添加到 web.config。

Also, XDT support is available starting 2.2.100-preview1.此外,从 2.2.100-preview1 开始提供 XDT 支持。

Sample: https://github.com/vijayrkn/webconfigtransform/blob/master/README.md示例: https ://github.com/vijayrkn/webconfigtransform/blob/master/README.md

Rather than hardwiring dev settings, add this to your .csproj :而不是硬连线开发设置,将其添加到您的.csproj

<!-- Adds EnvironmentName variable during publish -->
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
    <EnvironmentName>Development</EnvironmentName>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Release'">
    <EnvironmentName>Production</EnvironmentName>
</PropertyGroup>

A simple solution一个简单的解决方案

I use the current directory to determine the current environment and then flip the connection string and environment variable.我使用当前目录来确定当前环境,然后翻转连接字符串和环境变量。 This works great so long as you have a naming convention for your site folders, such as test , beta , and sandbox .只要您有站点文件夹的命名约定,例如testbetasandbox ,这就会非常有效。

protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
    var dir = Environment.CurrentDirectory;
    string connectionString;

    if (dir.Contains("test", StringComparison.OrdinalIgnoreCase))
    {
        connectionString = new ConnectionStringBuilder(server: "xxx", database: "xxx").ConnectionString;
        Environment.SetEnvironmentVariable("ASPNETCORE_ENVIRONMENT", "Development");
    }
    else
    {
        connectionString = new ConnectionStringBuilder(server: "xxx", database: "xxx").ConnectionString;
        Environment.SetEnvironmentVariable("ASPNETCORE_ENVIRONMENT", "Production");
    }

    optionsBuilder.UseSqlServer(connectionString);
    optionsBuilder.UseLazyLoadingProxies();
    optionsBuilder.EnableSensitiveDataLogging();
}

If you are using the Rider IDE (from JetBrains ) on Windows, Linux or Mac:如果您在 Windows、Linux 或 Mac 上使用Rider IDE(来自JetBrains ):

  • Click in Add Configuration ;点击添加配置 在此处输入图像描述
  • In the modal window, click in Add New... located in the left column.在模式窗口中,单击位于左栏中的Add New...。 无配置的模态窗口
  • Chose .NET project (the template will depend on your project type)选择.NET 项目(模板取决于您的项目类型)
  • In Environment Variables field, click in the document icon on the right side;环境变量字段中,单击右侧的文档图标; .NET 项目模式窗口中的环境字段。
  • In the new window, click on the + to create a new environment variable, which you will input the key/value ASPNETCORE_ENVIRONMENT/Development;在新窗口中,点击+创建一个新的环境变量,你将输入key/value ASPNETCORE_ENVIRONMENT/Development; 添加一个新的环境变量。
  • Click OK at the bottom right side of the window.单击窗口右下方的确定
  • Click Apply at the bottom right side of the window.单击窗口右下角的应用

Rider has included the launch settings for your project and has set it as the default for your project debugging and runs. Rider 已包含您项目的启动设置,并将其设置为项目调试和运行的默认设置。

环境设置结束和默认

Another option that we use in our projects in order to be able to set the environment per-site is to add a Parameters.xml file to the project with the following content:为了能够为每个站点设置环境,我们在项目中使用的另一个选项是将Parameters.xml文件添加到项目中,其中包含以下内容:

<parameters>
      <parameter name="IIS Web Application Name" defaultValue="MyApp" tags="IisApp" />
      <parameter name="Environment" description="Environment" tags="">
        <parameterEntry kind="XmlFile" scope="Web.config"  match="/configuration/location/system.webServer/aspNetCore/environmentVariables/environmentVariable[@name='ASPNETCORE_ENVIRONMENT']/@value" />
      </parameter>
</parameters>

The Build Action for this file is Content and the Copy Action is Copy If Newer , so it will be part of the package to deploy.该文件的Build ActionContent并且Copy ActionCopy If Newer ,因此它将成为要部署的包的一部分。

Then, to deploy the package and set the environment, in the Release, under the "WinRM - IIS Web App Deployment" task (it works just as well when using the "IIS web app deploy" task), we set additional arguments for msdeploy:然后,为了部署包和设置环境,在 Release 中,在“WinRM - IIS Web App Deployment”任务下(在使用“IIS web app deploy”任务时也同样有效),我们为 msdeploy 设置了额外的参数:

-setParam:kind=ProviderPath,scope=contentPath,value="MySite" -setParam:name="Environment",value="Stage"

This way we can have multiple releases, all using the same artifact, but deployed as different environments.这样我们可以有多个版本,都使用相同的工件,但部署为不同的环境。

I had to manually add this piece of code to my main method.我不得不手动将这段代码添加到我的主要方法中。 This will base the environment based on Azure's App Settings这将基于 Azure 的应用程序设置的环境

static async Task Main(string[] args)
{
   ...
   //set the environment variable based on App Settings
   var environment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");
   builder.UseEnvironment(environment);

I found it working for me by setting this variable directly on the Azure platform (if you use it).通过直接在 Azure 平台上设置这个变量(如果你使用它),我发现它对我有用。

Just select your web application → ConfigurationApplication settings and add the variable and its value.只需选择您的 Web 应用程序 →配置应用程序设置并添加变量及其值。 Then press the Save button.然后按保存按钮。

For .NET 6 i found this to be the nicest Solution:对于 .NET 6,我发现这是最好的解决方案:

var webAppOptions = new WebApplicationOptions()
{   
    Args = args,

    #if DEBUG
        EnvironmentName = Environments.Development,
    #else
        EnvironmentName = Environments.Production,
    #endif

};

var builder = WebApplication.CreateBuilder(webAppOptions);

We could also read the EnvironmentName from a config file and set it in the WebApplicationOptions before calling WebApplication.CreateBuilder我们还可以在调用WebApplicationOptions之前从配置文件中读取EnvironmentName并在WebApplication.CreateBuilder中设置它

Now we can also test the Production Environment on our development machine.现在我们还可以在我们的开发机器上测试生产环境。 We just have to switch to release build and we have the Production Environment.我们只需要切换到release版本,我们就有了生产环境。

No need to set any ENVIRONMENT variables.无需设置任何 ENVIRONMENT 变量。

The advatage of doing it like this is also that we can not accidently create a release build that runs under a Development Environment.这样做的好处还在于我们不会意外地创建在Development环境下运行的发布版本。

I was looking for an answer for this for last few days to understand how this can be achieved via Azure DevOps release pipeline deploying to Azure App Service.过去几天我一直在寻找这个问题的答案,以了解如何通过部署到 Azure 应用服务的 Azure DevOps 发布管道来实现这一点。 Here is what how I achieved it - Hope this will help you.这是我如何实现它的 - 希望这会对你有所帮助。

On Azure App Service deploy task > Set this value in Application & Configuration Settings : -ASPNETCORE_ENVIRONMENT ""在 Azure App Service 部署任务 > 在应用程序和配置设置中设置此值:-ASPNETCORE_ENVIRONMENT ""

在此处输入图像描述

You can directly add ASPNETCORE_ENVIRONMENT env into your web.config file:您可以直接将ASPNETCORE_ENVIRONMENT添加到您的 web.config 文件中:

<configuration>
  <system.webServer>
    <aspNetCore processPath="dotnet" arguments=".\MyProject.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" hostingModel="inprocess">
      <environmentVariables>
        <environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" />
      </environmentVariables>
    </aspNetCore>
  </system.webServer>
</configuration>

What might help for some:什么可能对某些人有帮助:

For a NET6 app;对于 NET6 应用程序; setting the ASPNETCORE_ENVIRONMENT to Development did not seem to work when I ran my published app locally.当我在本地运行已发布的应用程序时,将 ASPNETCORE_ENVIRONMENT 设置为 Development 似乎不起作用。

However, when copied to the server with IIS it did work... So might be due to local environment variables.但是,当使用 IIS 复制到服务器时,它确实可以工作......所以可能是由于本地环境变量。

But, then on the server my swagger docs were loaded, due to ASPNETCORE_ENVIRONMENT: Development.但是,由于 ASPNETCORE_ENVIRONMENT: Development 在服务器上加载了我的招摇文档。

I solved this by adding an extra appsettings.Staging.json file and publish with:我通过添加一个额外的 appsettings.Staging.json 文件解决了这个问题并发布:

dotnet publish -c Release -r win-x64 --no-self-contained /p:EnvironmentName=Staging 

Finally, I ensured that environment specific variables are not in the generic appsettings.json, but only in the respective appsettings.{env}.json files.最后,我确保环境特定变量不在通用 appsettings.json 中,而仅在相应的 appsettings.{env}.json 文件中。

You add these lines into the publish profile as others indicated before:如前所述,您将这些行添加到发布配置文件中:

<PropertyGroup>
    <EnvironmentName>Production</EnvironmentName>
</PropertyGroup>

Then use this syntax in the condition section of .csproj file, for example:然后在 .csproj 文件的条件部分使用此语法,例如:

<Exec WorkingDirectory="$(SpaRoot)" Command="npm build --prod" Condition="'$(EnvironmentName)' == 'Production'>

This one was also giving me troubles.这也给我带来了麻烦。 I don't want to have switches within my code and want to rule it from the outside.我不想在我的代码中进行切换,而是希望从外部进行控制。 And that is possible.这是可能的。 There are a lot of options what you see in the posts above.您在上面的帖子中看到的选项有很多。 This is what I did.这就是我所做的。

Setup code设置代码

In Program.cs add this在 Program.cs 添加这个

var _configuration = new ConfigurationBuilder()
    .SetBasePath(Directory.GetCurrentDirectory())
    .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
    .AddJsonFile($"appsettings.{builder.Environment.EnvironmentName}.json", optional: true)
    .AddEnvironmentVariables()
    .Build();

The forth sentence is for environmental settings in json. The fifth sentence is for overruling in staging and prod by using environment variables.第四句是json中的环境设置。第五句是通过环境变量在staging和prod中否决。

Then add three files:然后添加三个文件:

  • appsettings.json应用程序设置.json
  • appsettings.Development.json appsettings.Development.json
  • appsettings.Staging.json appsettings.Staging.json
  • appsettings.Production.json appsettings.Production.json

In appsettings.json I place the generic values for every environment.在 appsettings.json 中,我为每个环境放置了通用值。 IE the name of the application. IE 应用程序的名称。 In appsettings.Development.json I place the connection string.在 appsettings.Development.json 中,我放置了连接字符串。 You can also do that in Staging and Production.您也可以在暂存和生产中执行此操作。 I did that different for security reasons.出于安全原因,我做了不同的事情。

Tip提示

The setup above can run your environment in dev-mode.上面的设置可以在开发模式下运行您的环境。 In launchsettings.json you can change the AS.NETCORE_ENVIRONMENT to ie Staging to see how it works in test/staging mode.在 launchsettings.json 中,您可以将 AS.NETCORE_ENVIRONMENT 更改为 ie Staging 以查看其在测试/暂存模式下的工作方式。

Deployment部署

When I deploy to docker I overrule the environment setting to get the code running in the right environment.当我部署到 docker 时,我否决了环境设置以使代码在正确的环境中运行。 That is this way (this is is how pass from Nomad environment variables to docker, docker-compose will have a different format, but idea is the same):就是这样(这是从Nomad环境变量传给docker的方式,docker-compose格式会不一样,但是思路是一样的):

env {
    ASPNETCORE_ENVIRONMENT = "Staging"
    CONNECTIONSTRINGS__MYCS = "MyConnectionString"
}

When you work this way, you have clean code.当您以这种方式工作时,您将拥有干净的代码。

When I change the launch settings from say Debug to Staging I want the correct app<envronmentName>Settings.json to be loaded without having to remember to change the AS.NETCORE_ENVIRONMENT setting in the project from "Development" to "Staging".当我将启动设置从调试更改为暂存时,我希望加载正确的app<envronmentName>Settings.json而不必记住将项目中的AS.NETCORE_ENVIRONMENT设置从“开发”更改为“暂存”。 To this end I modify the Build conditional compilation symbols as follows;为此我修改Build条件编译符号如下;

[![enter image description here][1]][1] [![在此处输入图片描述][1]][1]

Within my code I then use;然后在我的代码中使用;

string environmentName = "";

#if DEBUG
    environmentName = "Development";
#elif STAGING
    environmentName = "Staging";
#else
    environmentName = "Production";
#endif

IConfigurationRoot config = new ConfigurationBuilder()
    .AddJsonFile("appsettings.json", optional: false)
    .AddJsonFile($"appsettings.{environmentName}.json", true)
    .AddUserSecrets(Assembly.GetExecutingAssembly(), true)
    .Build();

This synchronises the appSettings file used to match the launch configuration selected.这会同步用于匹配所选启动配置的appSettings文件。 [1]: https://i.stack.imgur.com/1XJlW.jpg [1]: https://i.stack.imgur.com/1XJlW.jpg

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ASP.Net Core 2.1 ASPNETCORE_ENVIRONMENT值未反映 - ASP.Net Core 2.1 ASPNETCORE_ENVIRONMENT value not reflecting 如何为控制台应用程序设置 ASPNETCORE_ENVIRONMENT? - How to set ASPNETCORE_ENVIRONMENT for console application? ASP.NET Core 3.1 - ASPNETCORE_ENVIRONMENT 的“开发”值在启动期间触发其他服务的生命周期验证 - ASP.NET Core 3.1 - `Development` value for ASPNETCORE_ENVIRONMENT triggers additional services' lifetimes validation during the startup 如何在运行时设置 ASPNETCORE_ENVIRONMENT 变量 - How to set ASPNETCORE_ENVIRONMENT variable at runtime ".NET Core 控制台应用程序和 aspnetcore_environment 变量" - .NET Core console app and aspnetcore_environment variable 如何在 AzureDevops 中为 Dockerfile 设置环境变量(ASPNETCORE_ENVIRONMENT)? - How to set environment variables (ASPNETCORE_ENVIRONMENT) in AzureDevops for Dockerfile? CLI的ASP.NET Core发布应用程序 - ASP.NET Core publishing application by CLI 在构建配置中设置aspnetcore_environment - Set aspnetcore_environment within build configuration 如何在 ASP.NET Core 3.0 中解密.AspNetCore.Identity.Application cookie? - How to decrypt .AspNetCore.Identity.Application cookie in ASP.NET Core 3.0? 如何在“生产”环境中Web部署ASP.NET Core应用程序? - How to WebDeploy an ASP.NET Core application in “Production” environment?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM