3

I'm trying to publish the template project "ASP.NET Core Web Application (.NET Framework)" from Visual Studio 2015 to IIS.

I use the Visual Studio publish to File System feature.

I'm using Windows 10.

I followed the guide from here.

  • I set up a website in IIS and changed the Application Pool .NET CLR Version to No Managed Code
  • I instaled the .NET Core Windows Server Hosting bundle
  • I restarted my machine.

I get this error:

HTTP Error 502.5 - Process Failure

I added a logs folder, but no logs get created.

Any ideas on how I can solve this?

EDIT:

Output of running the .exe from powershell:

PS C:\TestCoreWebsite> .\Web_CoreWebNetFramework.exe Hosting environment: Production Content root path: C:\TestCoreWebsite Now listening on: http://localhost:5000 Application started. Press Ctrl+C to shut down.

Then I navigate to http://localhost:5000 and the sample site works.

Maximilian Riegler
  • 22,720
  • 4
  • 62
  • 71
John-Luke Laue
  • 3,736
  • 3
  • 32
  • 60
  • does it work running on IIS Express? – gilmishal Sep 28 '16 at 16:23
  • 1
    Try running the `exe` file directly and see if you get any errors. If yes, please post them here, if not then there is an issue with IIS set up - web.config, file/folder permissions. Common errors are defined here: https://docs.asp.net/en/latest/publishing/iis.html#common-errors – Ignas Sep 28 '16 at 16:29
  • @Ignas The .exe works when I running it directly from powershell. I'll look into the file/folder permissions issue. – John-Luke Laue Sep 28 '16 at 16:54

4 Answers4

2

Found the solution:

In the root web.config change:

processPath="%LAUNCHER_PATH%"

to:

processPath=".\Web_CoreWebNetFramework.exe"
John-Luke Laue
  • 3,736
  • 3
  • 32
  • 60
2

I ran the following command in cmd

C:\fullpath\dotnet C:\fullpath\PROJECT.dll

on the command prompt, which gave me a much more meaningful error:

"The specified framework 'Microsoft.NETCore.App', version '1.0.1' was not found. - Check application dependencies and target a framework version installed at: C:\Program Files\dotnet\shared\Microsoft.NETCore.App - The following versions are installed: 1.0.0 - Alternatively, install the framework version '1.0.1'.

I Installed the correct net core and the project worked correctly

0

With VisualStudio 2017, open up the .csproj file and add to the first block:

<RuntimeFrameworkVersion>1.0.4</RuntimeFrameworkVersion>

Usually the result will be:

<PropertyGroup>
    <TargetFramework>netcoreapp1.1</TargetFramework>
    <RuntimeFrameworkVersion>1.0.4</RuntimeFrameworkVersion>
</PropertyGroup>
Kelly Orr
  • 751
  • 8
  • 17
0

For whoever faces the same issue as mine(running well in VS but got above issue when deploying into Local IIS), I missed Setting Environment Variable and It works after I added the Setting Environment Variable enter image description here

Ref: How to add Setting Environment Variable in IIS

Chinh Phan
  • 1,459
  • 19
  • 22