aspnetcore icon indicating copy to clipboard operation
aspnetcore copied to clipboard

ASP.NET Core 1.1 web application does not start when running with IIS Express in Visual Studio 2017

Open MrMatthewLayton opened this issue 9 years ago • 25 comments

I've already raised this issue with StackOverflow. This issue may already be addressed elsewhere and apologies if so, but I can't seem to find anything specific, and the suggestions on StackOverflow don't seem to work either:

Problem

I've recently installed Visual Studio 2017 Professional and have just created the boilerplate ASP.NET Core Web Application

This is what happens when I hit Run (With IIS Express):

And this is what Visual Studio 2017's Output window says:

The program '[8260] dotnet.exe' has exited with code -2147450749 (0x80008083). The program '[6476] iisexpress.exe' has exited with code 0 (0x0).

Assuming that this is a known issue, are there any steps to fix this, or any available updates to Visual Studio that will fix it?

MrMatthewLayton avatar Mar 31 '17 11:03 MrMatthewLayton

I experienced same issue on windows 10, I want to attach IIS Express Trace log files but github does not allow .xml extensions. I have also raised this issue on stackoverflow but no response.

DureSameen avatar Apr 02 '17 09:04 DureSameen

@DureSameen does running Visual Studio in admin mode yield any better results?

MrMatthewLayton avatar Apr 02 '17 10:04 MrMatthewLayton

no, there is no change in admin mode.

DureSameen avatar Apr 02 '17 11:04 DureSameen

@DureSameen I get the same thing when I run a .NET Core console application.

The program '[17372] dotnet.exe' has exited with code -2147450749 (0x80008083).

MrMatthewLayton avatar Apr 03 '17 10:04 MrMatthewLayton

@DureSameen try installing the x86 SDK, see if that helps...

https://www.microsoft.com/net/download/core

MrMatthewLayton avatar Apr 03 '17 10:04 MrMatthewLayton

A coworker and myself are seeing the same problem on Win7 and Win10 respectively.

I don't think the dotnet SDK is at fault here considering launching the project manually with dotnet run works just fine. It's only when launching from Visual Studio with IIS Express 10. Also, this problem doesn't occur when running a docker-compose project around the same aspnetcore binary.

I read on a different StackOverflow post that someone had success installing IIS8 to get an ASP.NET Core app running, so I'll be trying that here now.

tmcentee avatar Apr 03 '17 15:04 tmcentee

I found the issue.

When running an ASP.NET Core app in VS on IIS Express, you have to configure the web host to use IIS Integrations to handle IIS-specific runtime settings (like capturing IIS exceptions, etc.).

All I had to do was add the following to the WebHostBuilder in a fresh ASP.NET Core web application and it worked fine.

image

I'm not sure what effect this could have on other dependent projects (like running in docker) but I'll keep investigating as I go along with a new project we're starting.

tmcentee avatar Apr 03 '17 15:04 tmcentee

Considering a default dotnetcore project shouldn't have IIS configs in the template, I can see why it was left out. But it would be nice to contact the correct party to make sure something like that is setup when generating a project in VS, since IIS is the default server option in the project currently.

tmcentee avatar Apr 03 '17 15:04 tmcentee

This won't matter as much after https://github.com/aspnet/Templates/issues/837, we won't need UseIISIntegration in any templates anymore.

Also note that UseIISIntegration is a no-op if you launch your site outside of IIS/Express.

Tratcher avatar Apr 04 '17 03:04 Tratcher

I found the workaround.

The main issue was My machine already had Visual Studio 2015 Community Edition with updates side by side of Visual Studio 2017.

I removed it and then I tried to remove all individual program beginning with word Core (SDK and run time etc).

Then I remove .NET Core Command-Line Interface (CLI) Tools after that Visual Studio 2017 worked like a charm.

DureSameen avatar Apr 10 '17 19:04 DureSameen

This issue still persists after months of reporting it and has not been fixed. Yesterday, I downloaded the latest VS2017 15.1 updates and no fixes have been put in place.

wgrs avatar Apr 18 '17 11:04 wgrs

One of my colleagues is having the same issue. Dot net Run works fine, however we need IIS-Express for debugging. Ironically, only MVC project is not running but Web Api project runs fine.

He also has VS2015 installed previously, and that needs to be installed as he has to work on a legacy project which was built on VS2015.

Any advice will be appreciated. Thanks.

Zeshan-Munir avatar May 21 '17 22:05 Zeshan-Munir

@series0ne As this bug been resolved for you?

@the-super-coder Have you tried the suggested fix in this page? If it doesn't work, please open a new bug with reproduction step to your problem.

MaximRouiller avatar May 23 '17 12:05 MaximRouiller

My Colleague Umer was having this issue, I suggested the fixes on this issue but that did not work. He needs VS2015 and VS2017 both installed. So he has created a new issue here: https://github.com/aspnet/Home/issues/2041

Zeshan-Munir avatar May 25 '17 06:05 Zeshan-Munir

Hey gents, hope all is well. I was struggling with this as well and it seems like I might have found the solution. What works for me is closing the solution, navigating to where you keep the solution file and deleting .vs folder. Then open again and it works. It's obviously a workaround but at least a quick one. Also it seems it happens when I pull a lot of new projects via git. So that might be causing it somehow. Good luck!

PeterKottas avatar May 31 '17 08:05 PeterKottas

Hi @PeterKottas, Thanks for contributing.

@umerwaheed, Could you please try if this temporary workaround could get us working?

Zeshan-Munir avatar May 31 '17 22:05 Zeshan-Munir

@PeterKottas @the-super-coder still not working :(.

umerwaheed avatar Jun 01 '17 11:06 umerwaheed

I had this same issue and after digging around for a while I discovered that I had dotnet preview v1.0.0-preview2 installed under Programs Files (x86) and a non-preview version in x64. I think VS is launching the x86 (preview) version but expecting to see the full version. To fix this, I did the following.

  • from programs and feature uninstall every visible dotnet core. (note: this did not remove the x86 preview)
  • go to https://www.microsoft.com/net/download/core#/sdk and install BOTH x86 and x64 SDK packages
  • open command line and from the root directory check run: dotnet --version (at the time of writting it was 1.0.4
  • fire up .net core project in VS 2017 and run.

When I did all of the above, I was able to start up the site in IIS Express from VS.

For the record: you dont need to run VS in administrator mode (unless your targeting full-blown IIS)

philblackburn avatar Jul 22 '17 10:07 philblackburn

@philblackburn solution worked for me

reminvestor avatar Aug 03 '17 17:08 reminvestor

So... I had this issue using IIS Express as well, I switched to self-hosting all of my microservices... I have a project with about 10 ASP.NET Core web-api projects.

Unfortunately that didn't fully solve the issue.... Visual Studio now launches a bunch of windows for the Kestrel sessions, but randomly, some don't do anything, they just sit there idle with no text, and the browser windows only open up for the ones actively doing something. So frustrating when you waste hours a week just trying to get a stable debug session going...I don't know if there is a separate issue reported for that somewhere or if it falls under the same issue.

dguisinger avatar Sep 21 '17 14:09 dguisinger