Ktash Ktash - 1 year ago 427
ASP.NET (C#) Question

IIS Express launched from VS 2015 cannot read config file with <aspNetCore> element

I'm trying to get an ASP.Net project set up to run in Visual Studio 2015 from existing code (originally created in VS Code and run from command line).

In my web.config file, I have the following block:

<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" />

Visual Studio 2015 (with Update 3) gives the
element a squiggly underline and says that element can't be a child element of
. When I launch the site, I get the following error.

HTTP Error 500.19 - Internal Server Error The requested page cannot be
accessed because the related configuration data for the page is

Detailed Error Information: Module IIS Web Core Notification

Unknown Handler Not yet determined Error Code 0x8007000d Config
Error Config File


If I remove that line, IIS Express complains with the error "Handler "aspNetCore" has a bad module "AspNetCoreModule" in its module list". If I remove the whole block, it does not go through ASP.Net and tries to list the directory (which is forbidden by the security rules).

Most trouble-shooting steps say I should install the URL Rewrite module, but that is for IIS and I have read that it doesn't work for IIS Express. But I attempted to install it anyway to no luck.

My logs at Documents/IISExpress/Logs don't seem to have any useful information. How can I further troubleshoot or remedy this issue?

Answer Source

My issue was that I did not have a reference to ".NETCoreApp" to my project. I was also unable to add it to the project I created using the files. The only was I was able to get it to work was by creating a new project and copying all the files over. Which became a bit of a process with the git mv's, but all appears to be working now. So double-check that you have a ".NETCoreApp" reference in your project.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download