gpt4 book ai didi

iis - 无法加载应用程序或执行命令 'Microsoft.AspNet.Server.Kestrel'

转载 作者:行者123 更新时间:2023-12-04 13:06:56 24 4
gpt4 key购买 nike

我正在尝试将我的 ASP.NET 5 WebApi 部署到远程服务器(Windows Server 2008 R2),但无法使用 IIS 正确运行它。

项目.json

{
"webroot": "wwwroot",
"version": "1.0.0-*",

"dependencies": {
"App.Data": "1.0.0-*",
"App.Model": "1.0.0-*",
"App.Repository": "1.0.0-*",
"App.ViewModel": "1.0.0-*",
"AutoMapper": "4.1.1",
"Microsoft.AspNet.Authentication": "1.0.0-rc2-16009",
"Microsoft.AspNet.Authentication.JwtBearer": "1.0.0-rc2-16009",
"Microsoft.AspNet.Diagnostics": "1.0.0-rc2-16136",
"Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc2-15873",
"Microsoft.AspNet.Mvc": "6.0.0-rc2-16377",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-rc2-16017",
"Microsoft.AspNet.Server.WebListener": "1.0.0-rc2-15932",
"Microsoft.AspNet.StaticFiles": "1.0.0-rc2-15916",
"Microsoft.Framework.Configuration.Json": "1.0.0-rc1-15666",
"Microsoft.Framework.Logging": "1.0.0-rc1-15644",
"Microsoft.Framework.Logging.Console": "1.0.0-rc1-15644",
"Microsoft.IdentityModel.Protocols.OpenIdConnect": "2.0.0-rc1-211120828"
},

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

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

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

当我尝试从浏览器访问应用程序时,我没有收到任何响应。当我执行 web.cmd 时在服务器上,我收到以下错误:
Error: Unable to load application or execute command 'Microsoft.AspNet.Server.Ke
strel'. Available commands: kestrel, web.
System.IO.FileNotFoundException: Le fichier spécifié est introuvable. (Exception
de HRESULT : 0x80070002)
à System.Reflection.RuntimeAssembly.nLoadFile(String path, Evidence evidence)

à System.Reflection.Assembly.LoadFile(String path)
à Microsoft.Dnx.Runtime.Loader.LoadContext.LoadFile(String assemblyPath)
à Microsoft.Dnx.Runtime.Loader.PackageAssemblyLoader.Load(AssemblyName assemb
lyName, IAssemblyLoadContext loadContext)
à Microsoft.Dnx.Runtime.Loader.PackageAssemblyLoader.Load(AssemblyName assemb
lyName)
à Microsoft.Dnx.Host.LoaderContainer.Load(AssemblyName assemblyName)
à Microsoft.Dnx.Host.DefaultLoadContext.LoadAssembly(AssemblyName assemblyNam
e)
à Microsoft.Dnx.Runtime.Loader.AssemblyLoaderCache.GetOrAdd(AssemblyName name
, Func`2 factory)
à Microsoft.Dnx.Runtime.Loader.LoadContext.LoadAssemblyImpl(AssemblyName asse
mblyName)
à Microsoft.Dnx.Runtime.Loader.LoadContext.ResolveAssembly(Object sender, Res
olveEventArgs args)
à System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String as
semblyFullName)

感谢您的帮助

最佳答案

确保在目标服务器上安装了所有依赖项。运行 dnu list在 cmd 中查看所有项目依赖项。

如果其中一些未安装(它们将显示为红色)运行 dnu restore恢复所有包。

您还可以通过运行 dnu build 来确保您的项目成功构建。

希望能帮助到你..

关于iis - 无法加载应用程序或执行命令 'Microsoft.AspNet.Server.Kestrel',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33756373/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com