更新:即使是新的.net核心Web应用程序也显示相同的错误。
我正在使用.Net Core Version 1.0.0-preview2-003131。
我将.Net Core SDK从版本1.0.0-preview2-003121升级到上面提到的。现在,当我尝试运行应用程序时,我收到错误:ERR_CONNECTION_REFUSED
当我在互联网上搜索时,大部分内容都是改变端口号。我改变了它,它仍然无法正常工作。
任何想法如何解决这个问题?
project.json文件是:
{
"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%" ]
}
}
修改
答案 0 :(得分:2)
当我将应用程序更新为Microsoft.NETCore.App时,我个人偶然发现了类似的问题:1.1.1
在我的情况下,它会在运行时抛出一堆警告,警告"元素' xxx'在命名空间' http // schemas.microsoft.com / developer / msbuild / 2003'有无效的子元素...
目前正在回滚到Microsoft.NETCore.App:1.1.0将会这样做。
答案 1 :(得分:1)
转到MyWebApplication\.vs\config\applicationhost.config
验证bindingInformation
PORT 是Right click on your project > Debug > App URL
答案 2 :(得分:0)
同样的问题。在简单宠物项目中从Core 1.1.0升级到1.1.1 - 无法在IIS Express上运行\ debug。看起来Core 1.1.1版本不够稳定。
答案 3 :(得分:0)
我发现当我们在dependencies
<{1}} project.json
下错过以下内容时会发生这种情况
"Microsoft.NETCore.App": {
"version": "1.0.1",
"type": "platform"
}
注意如果版本错误(在上面提到的那样),那么我们也会看到相同的错误。