0

过程失效当我尝试启动我的ASP.NETcore 1.1我的服务器我得到的错误:ASP.NET 1.1的核心HTTP错误502.5 - 在启动

HTTP Error 502.5 - Process Failure

Common causes of this issue:

The application process failed to start The application process started but then stopped The application process started but failed to listen on the configured port

我检查事件查看器。

Application: MyApp.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.IO.FileLoadException at MyApp.Program.Main(System.String[])

MyApp.Program.Main

public class Program 
    { 
     public static void Main(string[] args) 
     { 
      Console.Title = "IdentityServer"; 

      var host = new WebHostBuilder() 
       .UseKestrel() 
       .UseUrls("http://localhost:5000") 
       .UseContentRoot(Directory.GetCurrentDirectory()) 
       .UseIISIntegration() 
       .UseStartup<Startup>() 
       .Build(); 

      host.Run(); 
     } 
    } 

这是基于在Identity Server 4码。

Stdout

Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'Microsoft.AspNetCore.Hosting, Version=1.1.0.0

我已经通过的NuGet添加Microsoft.AspNetCore.Hosting到我的项目。 Microsoft.AspNetCore.Hosting.dll是在我发布的文件...

经过一些更多的挖掘后,我发现这个职位Can't load Microsoft.AspNetCore.Hosting 1.1.0.0 #1826。它建议删除app.AddBrowserLink();。我的代码中完全没有使用AddBrowserLink()

通过注释掉代码,当我参考一个不是基于.NET Core的项目(取决于传统.NET)时,错误似乎出现了。

我使用Visual Studio 2017

+0

您是否尝试添加对“Microsoft.AspNetCore.Server.Kestrel”的引用? – Mashton

回答

相关问题