JayNaz
JayNaz

Reputation: 363

.NET Core WebApi Hosting Issue in IIS Express

I'm trying to host .Net Core2 default WebApi project on my Local IIS Server in Windows 10.

I just published the default project to a local folder without making any change on it and hosted it on IIS. But it gives me this error when I try to access the URI

enter image description here

My web.config file as follow:

<?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=".\ToHost2.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
   </system.webServer>
</configuration>
<!--ProjectGuid: 3be731b8-79e8-4828-a016-54606c34c081-->

Please help me to track where I have made mistake.

Thanks in advance

Upvotes: 1

Views: 1292

Answers (2)

RiyajKhan
RiyajKhan

Reputation: 53

Convert the Web api project folder as application in IIS tool.

right click on api project folder and convert as application i think it will be work for you

Upvotes: 0

Dimitar Tsonev
Dimitar Tsonev

Reputation: 3882

You need to install the .NET Core Windows Server Hosting bundle

Upvotes: 1

Related Questions