1

I keep getting the following error when I try to debug my .NET-Core application:

An error occurred attempting to determine the process id of Test.exe which hosting your application

I have googled around and I see many having this problem with SSL. But I don't have SSL.

I have also tried to remove the json lock file, but that don't work either..

Should I modify something in project.json?

Here is my project.json:

{
  "userSecretsId": "aspnet-Testar-0b0a75f7-4784-4192-a127-a1a4183a2709",

  "dependencies": {
    "Microsoft.AspNetCore.Authentication.Cookies": "1.0.0",
    "Microsoft.AspNetCore.Diagnostics": "1.0.0",
    "Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.0.0",
    "Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0",
    "Microsoft.AspNetCore.Mvc": "1.0.1",
    "Microsoft.AspNetCore.Razor.Tools": {
      "version": "1.0.0-preview2-final",
      "type": "build"
    },
    "Microsoft.AspNetCore.Routing": "1.0.1",
    "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
    "Microsoft.AspNetCore.Server.Kestrel": "1.0.1",
    "Microsoft.AspNetCore.StaticFiles": "1.0.0",
    "Microsoft.EntityFrameworkCore.SqlServer": "1.0.1",
    "Microsoft.EntityFrameworkCore.SqlServer.Design": {
      "version": "1.0.1",
      "type": "build"
    },
    "Microsoft.EntityFrameworkCore.Tools": {
      "version": "1.0.0-preview2-final",
      "type": "build"
    },
    "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
    "Microsoft.Extensions.Configuration.Json": "1.0.0",
    "Microsoft.Extensions.Configuration.UserSecrets": "1.0.0",
    "Microsoft.Extensions.Logging": "1.0.0",
    "Microsoft.Extensions.Logging.Console": "1.0.0",
    "Microsoft.Extensions.Logging.Debug": "1.0.0",
    "Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
    "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0",
    "Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
      "version": "1.0.0-preview2-final",
      "type": "build"
    },
    "Microsoft.VisualStudio.Web.CodeGenerators.Mvc": {
      "version": "1.0.0-preview2-final",
      "type": "build"
    }
  },

  "tools": {
    "BundlerMinifier.Core": "2.0.238",
    "Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final",
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final",
    "Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final",
    "Microsoft.Extensions.SecretManager.Tools": "1.0.0-preview2-final",
    "Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
      "version": "1.0.0-preview2-final",
      "imports": [
        "portable-net45+win8"
      ]
    }
  },

  "frameworks": {
    "net452": { }
  },

  "buildOptions": {
    "emitEntryPoint": true,
    "preserveCompilationContext": 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%" ]
  }
}

I'm using .NET framework 4.5.2

halfer
  • 19,824
  • 17
  • 99
  • 186
Bryan
  • 3,421
  • 8
  • 37
  • 77
  • I am not sure if this is your exact problem, but some of the solutions you tried are also described in this question: http://stackoverflow.com/questions/33166403/an-error-occurred-attempting-to-determine-the-process-id-of-the-dnx-process-host - perhaps another answer there does fix your problem? – nbokmans Feb 17 '17 at 09:45
  • Which tool/IDE (+version) do you use to debug? Can you share your project.json and which dotnet-sdk version are you using? – Joel Harkes Feb 17 '17 at 09:48

2 Answers2

4

Maybe you can try delete the .vs folder.

Can't start with F5 using IIS Express

It used to saved my days!

snys98
  • 96
  • 4
  • WHere is the .vs-folder located? – Bryan Feb 17 '17 at 09:54
  • In the *.sln folder, it's hidden by default. – snys98 Feb 17 '17 at 10:02
  • 1
    It worked for me. Just deleting .vs didn't do it. I also had to follow the steps under "Resolution Number #2" in the article it links to ([here](https://blogs.msdn.microsoft.com/robert_mcmurray/2013/11/15/how-to-trust-the-iis-express-self-signed-certificate/)). – Mark Johnson Mar 26 '17 at 10:55
  • @MarkJohnson You should post your comment as an answer because that helped me out in resolving the same issue. – hbulens Jun 28 '17 at 13:10
0

I was able to resolve this same issue by deleting the .vs folder (as syns98 suggested) and then importing the local IIS Express certificate as described under "Resolution Number #2" here.

Mark Johnson
  • 168
  • 1
  • 8