I have three profiles the only difference between the three is that I would like to set ASPNETCORE_ENVIRONMENT in the web.config. Like @Rick-Anderson edit to show code
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\PocketNurse.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout">
<environmentVariables>
<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Omnicell" />
</environmentVariables>
</aspNetCore>
</system.webServer>
</configuration>
Everytime I publish I have to edit the web.config file and add the
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
@KevinBurton can you ask that on SO?
I just did. Thank you.
@KevinBurton
Everytime I publish I have to edit the web.config file
You can disable the transformation of the file on publish by adding this to your project file ...
<IsTransformWebConfigDisabled>true</IsTransformWebConfigDisabled>
https://docs.microsoft.com/aspnet/core/host-and-deploy/iis#webconfig-file
I added this line to the project file and my project will no longer load. Visual Studio indicates that the project is "unavailable"
You put it into a PropertyGroup? ... Sorry if I didn't make that clear. Add it at the top where your target framework, etc. are located ...
<PropertyGroup>
<IsTransformWebConfigDisabled>true</IsTransformWebConfigDisabled>
<TargetFrameworks>netcoreapp2.1</TargetFrameworks>
</PropertyGroup>
Thank you. Now web.config is not in the published output.
does'nt work for me
I also tried
<ANCMPreConfiguredForIIS>true</ANCMPreConfiguredForIIS>
and I get a 500 error
Most helpful comment
Thank you. Now web.config is not in the published output.