0

After a dotnet publish, the arguments within the published web.config's <aspNetCore/> tag are not replaced, instead the new location is added to the start.

Before publish

<aspNetCore processPath="dotnet" arguments=".\bin\Debug\netcoreapp3.1\Company.Web.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />

After publish

<aspNetCore processPath="dotnet" arguments=".\Company.Web.dll .\bin\Debug\netcoreapp3.1\Company.Web.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />

Desired

<aspNetCore processPath="dotnet" arguments=".\Company.Web.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />

Has anybody experienced this transformation is not working properly?
(edit - added the before publish tag)

  • Can you share the `` tag source code in your web.config file (i.e. without publish)? – Mohsin Mehmood Apr 13 '20 at 16:38
  • yes, that would have been a good idea! – user3241900 Apr 13 '20 at 16:44
  • I expect that your web application web.config has placeholders which will be replaced during publish `processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%"`. Check this SO post: https://stackoverflow.com/questions/37463186/asp-net-core-1-0-rc2-what-are-launcher-path-and-launcher-args-mentioned-in-web – Mohsin Mehmood Apr 13 '20 at 16:47
  • Though I believe you're in the right area, I'm not sure that's the entire picture - I'm usually running my application though IIS (with a related .net 4 legacy application and IIS Express makes it more difficult). Though publishing locally works the first time, a subsequent publish make the undesired change. Publishing though an agent though a build agent (dev.azure.com) always causes this issue. I've considered making a transformation to adjust this value on deployment as a possible workaround, but I was hoping to fix it in the actual publish. Thanks for your suggestion BTW! – user3241900 Apr 13 '20 at 17:56

0 Answers0