2

I am having issues deploying my .NET Core 2.0 project to IIS

I followed the instructions listed here: https://learn.microsoft.com/en-us/aspnet/core/publishing/iis?tabs=aspnetcore2x#common-errors

I publish using Visual Studios enter image description here

When I try to access my published project via the browser I get this error message

enter image description here

Looking at the Event Viewer on my IIS server I see the following error

enter image description here

I installed the .NET SDK so the dotnet command is available at the terminal.

I added a global.json file that specifies the correct dotnet SDK per the instructions found in this link: https://github.com/aspnet/JavaScriptServices/issues/495 but that did not resolve the issue.

How can I publish my .NET Core 2.0 WebAPI+Angular4 project to IIS?

EDIT:

I can launch the application manually with dotnet MPMWebsiteLogins.dll

EDIT 2:

I updated my web.config and explicitly specified my path for dotnet.exe and MPMWebsiteLogins.dll

<aspNetCore processPath="C:\Program Files\dotnet\dotnet.exe" arguments="C:\inetpub\WebApps\HPIssuesUtilityV2\MPMWebsiteLogins.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" />

I am now getting this error in my event viewer:

Application 'MACHINE/WEBROOT/APPHOST/MPMWEBSITELOGINS' with physical root 'C:\inetpub\WebApps\HPIssuesUtilityV2\' created process with commandline 'C:\Program Files\dotnet\dotnet.exe C:\inetpub\WebApps\HPIssuesUtilityV2\MPMWebsiteLogins.dll' but failed to listen on the given port '1989'

enter image description here

3
  • What's the output if you just run dotnet MPMWebsiteLogins.dll? Commented Nov 1, 2017 at 8:10
  • @Kirk the application runs just fine with dotnet MPMWebsiteLogins.dll Commented Nov 1, 2017 at 21:30
  • For the original problem - you need add the path to where dotnet.exe is to your System PATH environment variable and you have to restart your server. For the port problem - likely something (maybe even your own application) is using this port. Make sure that you are not running anything that uses this port. If this is a dev machine stop IISExpress (from the tray/notification area) Commented Nov 4, 2017 at 2:31

2 Answers 2

1

I had to execute net stop was /y followed by net start w3svc from the command prompt to pick up a change to the system PATH.

Sign up to request clarification or add additional context in comments.

Comments

0

Seems like you are missing the ACNM module for reverse proxy. If you install the .Net core windows server hosting bundle it should install all the require components for you. You can double check by checking your IIS modules, it should have ASPnetcore.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.