Web application won't run

3

ASP.NET Core, NOT framework

I created a web API project a while ago to act as a local development host for some projects we use. This has been working fine. I don't know if I've installed a VS 2017 update between it working and not working. Now, when I launch it, it launches the web browser and then immediately terminates the web application (see output).

I decided to try and rebuild my project by creating a new one, and to my surprise I'm also getting an issue here. I've included the output and steps with which I can produce the issue on my machine.

Output:

code:-32000
message:No script for id: 35
'dotnet.exe' (CoreCLR: DefaultDomain): Loaded 'C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App\1.1.2\System.Private.CoreLib.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
The program '[18760] dotnet.exe: Program Trace' has exited with code 0 (0x0).
The program '[18760] dotnet.exe' has exited with code -532462766 (0xe0434352).
The program '[7360] iisexpress.exe: Program Trace' has exited with code 0 (0x0).
The program '[18824] chrome.exe: WebKit' has exited with code -1 (0xffffffff).
The program '[7360] iisexpress.exe' has exited with code 0 (0x0).

Steps to reproduce:

1) Select File | New Project
2) Select Templates > Visual C# > .NET Core > ASP.NET Core Web Application (.NET Core)
3) Click OK
4) Select Web API
5) Verify that "Enable Docker Support" is unchecked and "Authentication" is "No Authentication"
5) Click OK
6) Select Debug | Start Debugging
7) Wait ~20 seconds for the project co crash

I have tried putting a breakpoint on the opening curly brace of the "Main" method, but this is never hit.

Console output using dotnet run:

C:\Projects\WebApplication1>dotnet run
The current project is not valid because of the following errors:
C:\Projects\WebApplication1(1,0): error DOTNET1017: Project file does not exist 'C:\Projects\WebApplication1\project.json'.


C:\Projects\WebApplication1>

I'm unsure why project.json is expected since these were done away with in favour of .csproj files. Looking at the application properties, I can see that the Target Framework is .NETCoreApp1.1. In an attempt to fix this, I've installed .NET Core runtimes (x86 AND x64) versions 1.0.5 and 1.1.2, though I imagine only the 1.1.2 version is needed.

I've also run dotnet --info and I get the following output:

C:\Users\john\Documents\Visual Studio 2017\Projects\WebApplication1>dotnet --info
.NET Command Line Tools (1.0.0-preview2-003121)

Product Information:
 Version:            1.0.0-preview2-003121
 Commit SHA-1 hash:  1e9d529bc5

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.14393
 OS Platform: Windows
 RID:         win10-x86

Installed SDK versions (according to Programs and Features):

.NET Core SDK 1.0.0 (x64) Installer (x64)
.NET Core SDK 1.0.1 (x64)
.NET Core SDK 1.0.3 (x64)
.NET Core SDK 1.0.4 (x64)
Microsoft .NET Core 1.0.0 - SDK Preview 2 (x86)
Microsoft .NET Core 1.0.0 - SDK Preview 2 (x64)
Microsoft .NET Core 1.0.1 - SDK Preview 1.0.0 Preview 2-003131 (x64)
Microsoft .NET Core 1.0.1 - VS 2015 Tooling Preview 2-003131
Microsoft .NET Core 1.0.5 - Runtime (x64)
Microsoft .NET Core 1.0.5 - Runtime (x86)
Microsoft .NET Core 1.1.2 - Runtime (x64)
Microsoft .NET Core 1.1.2 - Runtime (x86)

Other info:

  • I'm running Windows 10 Enterprise N
  • My development environment is Visual Studio Enterprise 2017 version 15.2 (26430.6) release.

How do I get this to work again?

c#
asp.net-core
.net-core
asked on Stack Overflow May 15, 2017 by Llama

4 Answers

2

There's a high probability that the 32 bit (x86) dotnet.exe host was on your PATH before the 64 bit one. Since the only 32 bit SDK present was a preview2 version, you got an error about a missing project.json file. When you re-run installers, this probably fixed the path problem (probably just by accident).

You can check your system's PATH environment variable to see if the C:\Program Files\dotnet folder is listed before C:\Program Files (x86)\dotnet. VS 2017 previews (~RC3 time) had the habit of putting the 32bit one on the path before the 64bit one which caused a lot of issues.

answered on Stack Overflow May 15, 2017 by Martin Ullrich
1

After compiling the list of installed framework versions, I felt that it might be a little cluttered and, given the output of dotnet --info, I couldn't help wondering if there might not be some kind of version selection problem.

I uninstalled all of the SDK versions listed in Programs and Features, and simply re-downloaded the Windows (x64) Installer for the .NET Core SDK.

This seems to have resolved the issue, though I'm not sure what kind of updated happened to trigger it to change from "working without issue" to "won't even get as far as the Main method". Unfortunately, it seems increasingly par for the course with Microsoft.

answered on Stack Overflow May 15, 2017 by Llama
0

I think you need to enable IIS on your local in order for IIS Express to work.

If IIS is already enabled you may want to do the work around from the link below.

Control Panel > Programs and Features >

Turn Windows Features on or off.

enter image description here

Click Internet Information Services.

enter image description here

Don't worry about the child nodes. Click Ok.

Restart you PC.

However if that didn't work please read this article : http://gauravmantri.com/2013/02/05/workaround-for-iis-express-crashing-when-running-windows-azure-cloud-service-web-role-with-multiple-instances-in-windows-azure-sdk-1-8-compute-emulator/

answered on Stack Overflow May 15, 2017 by Drew Aguirre
0

I think you need to disable Just My Code in visual studio.

To disable Just My Code, choose Options and Settings on the Debug menu. In the Debugging / General node, clear Enable Just My Code.

enter image description here

And always make sure to run your project in debug mode while in debugging and make sure that your Web-API project is Set as Default among all the projects in the solution.

Hope it solves your issue.

answered on Stack Overflow May 15, 2017 by Sudip

User contributions licensed under CC BY-SA 3.0