问题
Update: Even a new .net core web application is showing the same error.
I'm using .Net Core Version 1.0.0-preview2-003131.
I upgraded a .Net Core SDK from Version 1.0.0-preview2-003121 to the above mentioned. Now when I try to run the application I get the error: ERR_CONNECTION_REFUSED
When I searched on Internet most of the stuff is to change the Port number. I change that and it still doesn't work.
Any ideas how to fix this?
The project.json file is:
{
"userSecretsId": "aspnet-Angle_MVC6_jQuery-f82e2f9a-a8b7-4a73-83f2-8e1da291a076",
"dependencies": {
"Microsoft.AspNetCore.Razor.Tools": {
"version": "1.0.0-preview2-final",
"type": "build"
},
"Microsoft.AspNetCore.Diagnostics": "1.1.1",
"Microsoft.AspNetCore.Mvc": "1.1.2",
"Microsoft.AspNetCore.Routing": "1.1.1",
"Microsoft.AspNetCore.Server.IISIntegration": "1.1.1",
"Microsoft.AspNetCore.Server.Kestrel": "1.1.1",
"Microsoft.AspNetCore.StaticFiles": "1.1.1",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.1",
"Microsoft.Extensions.Configuration.Json": "1.1.1",
"Microsoft.Extensions.Logging": "1.1.1",
"Microsoft.Extensions.Logging.Console": "1.1.1",
"Microsoft.Extensions.Logging.Debug": "1.1.1",
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.1.1",
"Microsoft.NETCore.App": {
"version": "1.1.1",
"type": "platform"
},
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.1.0"
},
"tools": {
"BundlerMinifier.Core": "2.4.337",
"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%" ]
}
}
EDIT
My Debug configuration is as
And the Solution Explorer window is
回答1:
I personally stumbled onto a similar issue when I updated my app to Microsoft.NETCore.App: 1.1.1
In my case it throws a bunch of warnings at run-time with warnings about "element 'xxx' in namespace 'http//schemas.microsoft.com/developer/msbuild/2003' has invalid child element...
For the time being rolling back to Microsoft.NETCore.App: 1.1.0 will do.
Some Info that I found related to the issue
回答2:
Go to MyWebApplication\.vs\config\applicationhost.config
verify if the bindingInformation
PORT is the same port in Right click on your project > Debug > App URL
回答3:
The same problem. Upgraded from Core 1.1.0 to 1.1.1 in simple pet project - can't run\debug on IIS Express. Looks like Core 1.1.1 build isn't stable enough.
回答4:
I figured it out that this happens when we are missing the following under the dependencies
in project.json
"Microsoft.NETCore.App": {
"version": "1.0.1",
"type": "platform"
}
NOTE If the version is wrong (in the above mentioned) then also we see the same error.
来源:https://stackoverflow.com/questions/42684336/err-connection-refused-net-core-1-0-1