Ich habe eine Dotnet-Kern-Anwendung, die ich remote auf einem Testserver bereitstellen. Die ASPNETCORE_ENVIRONMENT-Variable sollte auf dem Remotecomputer auf "Entwicklung" festgelegt werden. Bei jeder Bereitstellung wird die Variable ASPNETCORE_ENVIRONMENT mit "Entwickeln" überschrieben. Ich muss in den IIS-Admin-Konfigurationseditor gehen und die falsche ASPNETCORE_ENVIRONMENT-Variable bei jeder Bereitstellung ersetzen.ASPNETCORE_ENVIRONMENT bei der Bereitstellung überschrieben
Kann mir jemand helfen zu verstehen, warum diese Variable bei jeder Bereitstellung überschrieben wird?
Hier ist meine Datei web.config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<compilation>
<buildProviders>
<remove extension=".xml" />
<add extension=".xml" type="System.Web.Compilation.ForceCopyBuildProvider" />
</buildProviders>
</compilation>
</system.web>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\WorkersCompensation.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="true">
<environmentVariables>
<clear />
<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" />
</environmentVariables>
</aspNetCore>
</system.webServer>
</configuration>
Hier ist meine Dev.pubxml Datei:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>FileSystem</WebPublishMethod>
<LastUsedBuildConfiguration>Debug</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<PublishFramework>netcoreapp1.0</PublishFramework>
<UsePowerShell>True</UsePowerShell>
<publishUrl>\\esdev2.elwood.local\D$\Core\WorkersCompensation </publishUrl>
<DeleteExistingFiles>False</DeleteExistingFiles>
<ExcludeFoldersFromDeployment>wwwroot\node_modules </ExcludeFoldersFromDeployment>
<UseMsDeployExe>true</UseMsDeployExe>
</PropertyGroup>
<ItemGroup>
<MsDeploySkipRules Include="SkipNodeModules">
<AbsolutePath>wwwroot\node_modules</AbsolutePath>
</MsDeploySkipRules>
</ItemGroup>
</Project>