0
votes

Yesterday I started using ASP.NET Core, created my project using a default template and started my work. All good and well, then I added a method to the Home Controller. After that I just was not able to run my application using IIS Express anymore. I can see that IIS Express tries to start up and then crashes.

The IIS Express log is empty. In the event viewer I get a failure for IIS (Error code: '0x80004005') which seems to be more related to Updates failing.

I have checked the bindings in the applicationhost.config file. I have deleted the IISExpress folder under the Documents folder. I have also enabled logging in my web.config (stdoutLogEnabled), nothing is logged here.

All nuget and bower packages are loaded.

This happens only for ASP.NET Core projects, all the others ASP.NET Framework projects I can still run using IIS Express.

Has anybody got any idea of where I can start to trouble shoot?

Thank you in advance

Here is the project.json file

{
    "dependencies": {
        "Microsoft.AspNetCore.Razor.Tools": {
          "version": "1.0.0-preview2-final",
          "type": "build"
    },
    "BundlerMinifier.Core": "2.2.306",
    "Microsoft.ApplicationInsights.AspNetCore": "1.0.2",
    "Microsoft.AspNetCore.Diagnostics": "1.1.0",
    "Microsoft.AspNetCore.Mvc": "1.1.0",
    "Microsoft.AspNetCore.Routing": "1.1.0",
    "Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",
    "Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
    "Microsoft.AspNetCore.StaticFiles": "1.1.0",
    "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0",
    "Microsoft.Extensions.Configuration.Json": "1.1.0",
    "Microsoft.Extensions.Logging": "1.1.0",
    "Microsoft.Extensions.Logging.Console": "1.1.0",
    "Microsoft.Extensions.Logging.Debug": "1.1.0",
    "Microsoft.Extensions.Options.ConfigurationExtensions": "1.1.0",
    "Microsoft.NETCore.App": "1.1.0",
    "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.1.0"
  },

  "tools": {
    "Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final",
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
  },

  "frameworks": {
    "netcoreapp1.0": {
      "imports": [
        "dotnet5.6",
        "portable-net45+win8"
      ]
    }
},

"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},

"runtimeOptions": {
    "configProperties": {
      "System.GC.Server": true
    }
  },

  "publishOptions": {
        "include": [
          "wwwroot",
          "**/*.cshtml",
          "appsettings.json",
          "web.config"
        ]
  },

"scripts": {
    "prepublish": [ "bower install", "dotnet bundle" ],
    "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
  }
}
3

3 Answers

1
votes

Check your launchSettings.json file under Properties for the project.

The configuration should look something like this:

{
  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iisExpress": {
      "applicationUrl": "http://localhost:57340/",
      "sslPort": 0
    }
  },
  "profiles": {
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    },
    "xyzRetailer": {
      "commandName": "Project",
      "launchBrowser": true,
      "launchUrl": "http://localhost:57340/",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    }
  }
}

enter image description here

1
votes

It may be depndencies setting in the project.json if you do not install .net core 1.1 sdk and use nuget to update .netcore.app to 1.1.1 will meet this error Change the version from 1.1.1 to 1.0.1 and test again

0
votes

My project is now up and running, seems like it was a classic PEBKAC error.

When I created my project I selected the ASP.NET Core Web Application (.NET Core) instead of the ASP.NET Core Web Application (.NET Framework).

It must be that I am missing something in my local ASP.NET Core framework installation that causes the .NET Core project not to run. Some further investigation will commence in the near future.

Thank you for all the contributions.