4

When I am trying to debug an ASP.NET Core application in Visual Studio 2015, I am getting following error:

An error occurred attempting to determine the process id of the DNX process hosting your application

enter image description here

It is only happening in Windows 10. I tested with Windows 7 and I did not run into this error.

I am able to run using "web" option in Visual Studio 2015, but the error is happening with IIS Express. When I hit Ctrl+F5 (run without debugging), the browser window opens and just sits there doing nothing (cursor spins forever).

snapshot of toolbar:
enter image description here

The Output -> Debug window is empty, so not sure what is the root cause of this error. Not sure if there is anywhere else I have to look for more error details.

enter image description here

I have

  • Microsoft Visual Studio Professional 2015 Version 14.0.25123.00 Update 2
  • Microsoft .NET Framework Version 4.6.01038
  • Windows 10 pro v1511 OS build 10586.218
  • DNVM 1.0.0-rc1-15540
  • Microsoft .NET Development Utility Clr-x86-1.0.0-rc1-16609

I even tried a dnvm upgrade, which upgraded dnx to dnx-clr-win-x86.1.0.0-rc1-update2, but error is still occurring.

I tried most of the solutions listed in

An error occurred attempting to determine the process id of the DNX process hosting your application

and

An error occurred attempting to determine the process id of the DNX process hosting your application on clean installed windows 10 + vs2015

and none of them worked.

Here is a simple test application if any one wants to look at it.

https://github.com/vinodbadugu/aspnet5test

launchsettings.json

{
  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iisExpress": {
      "applicationUrl": "http://localhost:44342/",
      "sslPort": 0
    }
  },
  "profiles": {
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "launchUrl": "http://localhost:44342/",
      "environmentVariables": {
        "Hosting:Environment": "Development"
      },
      "sdkVersion": "dnx-clr-win-x86.1.0.0-rc1-update2"
    },
    "web": {
      "commandName": "web",
      "environmentVariables": {
        "Hosting:Environment": "Development"
      }
    }
  }
}

project.json

{
  "version": "1.0.0-*",
  "compilationOptions": {
    "emitEntryPoint": true
  },

  "dependencies": {
    "Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final",
    "Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final",
    "Microsoft.AspNet.Diagnostics":  "1.0.0-rc1-final"
  },

  "commands": {
    "web": "Microsoft.AspNet.Server.Kestrel"
  },

  "frameworks": {
    "dnx451": { },
    "dnxcore50": { }
  },

  "exclude": [
    "wwwroot",
    "node_modules"
  ],
  "publishExclude": [
    "**.user",
    "**.vspscc"
  ]
}

startup.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Hosting;
using Microsoft.AspNet.Http;
using Microsoft.Extensions.DependencyInjection;

namespace Tutorial1
{
    public class Startup
    {
        // This method gets called by the runtime. Use this method to add services to the container.
        // For more information on how to configure your application, visit http://go.microsoft.com/fwlink/?LinkID=398940
        public void ConfigureServices(IServiceCollection services)
        {
        }

        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app)
        {
            app.UseIISPlatformHandler();
            app.UseDeveloperExceptionPage();

            app.Run(async (context) =>
            {
                await context.Response.WriteAsync("Hello World!");
            });
        }

        // Entry point for the application.
        public static void Main(string[] args) => WebApplication.Run<Startup>(args);
    }
}

dnvm list

Active Version           Runtime Architecture OperatingSystem Alias
------ -------           ------- ------------ --------------- -----
       1.0.0-rc1-update1 clr     x64          win
       1.0.0-rc1-update1 clr     x86          win
       1.0.0-rc1-update1 coreclr x64          win
       1.0.0-rc1-update1 coreclr x86          win
  *    1.0.0-rc1-update2 clr     x86          win             default
       1.0.0-rc1-update2 coreclr x86          win
6
  • Are you running VS as Administrator? Commented Apr 29, 2016 at 19:12
  • yes, I tried with that option as well, no luck Commented Apr 29, 2016 at 19:14
  • What does your dnvm list output show? Commented Apr 29, 2016 at 19:17
  • i edited my post with dnvm list Commented Apr 29, 2016 at 19:22
  • Looks like it is an open issue. github.com/aspnet/Home/issues/1194 Commented May 6, 2016 at 16:51

2 Answers 2

2

What worked for me was installing the recent update of the "Microsoft ASP.NET and Web Tools" (Version 14.1.20512.0 -- dated 5/18/2016 - https://visualstudiogallery.msdn.microsoft.com/c94a02e9-f2e9-4bad-a952-a63a967e3935). The update was literally out the day after I tried almost everything. It even worked for debugging of apps on IISExpress with windows authentication enabled.

Sign up to request clarification or add additional context in comments.

2 Comments

I also downloaded the update this morning. That particular error went away, but hit another road block. Getting an error "Starting the web server is taking longer than expected". Going to do some research to figure out what is going on.
@Vinod, unrelated to the DNX issue, but I had downgraded my IISexpress to version 8 (instead of version 10) a month ago. Back then, I had trouble getting IISExpress 10 to start for another project. Upgrading back to IISExpress 10 did NOT help the DNX problem, so I downgraded back to version 8 again. Maybe you can give the downgrade a try.
1

Please edit your launchsettings.json restart VS and try to Debug again.

{
  ...
  "profiles": {
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "environmentVariables": {
        "Hosting:Environment": "Development"
      },
      "sdkVersion": "dnx-clr-win-x86.1.0.0-rc1-update2"
    },
    ...
}

1 Comment

I updated lauchsettings.json. Got same error. I even restarted the computer and opened VS as Adminsitrator. I also verified to make sure Visual Studio is picking up the changes from launchsettings.json and project properties windows shows Use Specific version: 1.0.0-rc1-update2. Getting same error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.