[英]Run Asp.net 5 vNext project (MVC6) publish build on Windows Server 2012 R2
I configurated everything according to some resources on the internet, but i don't know what i miss.. 我根据互联网上的一些资源配置了所有内容,但我不知道自己想念的是什么。
When i try to start it manually (Which works on my local computer!) i get the following result on the server: 当我尝试手动启动它时(在我的本地计算机上可以运行!),我在服务器上得到以下结果:
PS C:\Users\Administrator> cd C:\inetpub\wwwroot\approot\myproject\approot
PS C:\inetpub\wwwroot\approot\myproject\approot> .\web
Error: Unable to load application or execute command 'Microsoft.AspNet.Hosting'. Available commands: web, kestrel.
System.IO.FileNotFoundException: The system cannot find the file specified. (Exception from HRESULT: 0x80070002)
at System.Reflection.RuntimeAssembly.nLoadFile(String path, Evidence evidence)
at System.Reflection.Assembly.LoadFile(String path)
at Microsoft.Dnx.Runtime.Loader.LoadContext.LoadFile(String assemblyPath)
at Microsoft.Dnx.Runtime.Loader.PackageAssemblyLoader.Load(AssemblyName assemblyName, IAssemblyLoadContext loadContex
t)
at Microsoft.Dnx.Runtime.Loader.PackageAssemblyLoader.Load(AssemblyName assemblyName)
at Microsoft.Dnx.Host.LoaderContainer.Load(AssemblyName assemblyName)
at Microsoft.Dnx.Host.DefaultLoadContext.LoadAssembly(AssemblyName assemblyName)
at Microsoft.Dnx.Runtime.Loader.AssemblyLoaderCache.GetOrAdd(AssemblyName name, Func`2 factory)
at Microsoft.Dnx.Runtime.Loader.LoadContext.LoadAssemblyImpl(AssemblyName assemblyName)
at Microsoft.Dnx.Runtime.Loader.LoadContext.ResolveAssembly(Object sender, ResolveEventArgs args)
at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName)
Things done on Windows Server 2012: 在Windows Server 2012上完成的操作:
DNVM list outputs: DNVM列表输出:
Active Version Runtime Architecture OperatingSystem Alias
------ ------- ------- ------------ --------------- -----
1.0.0-rc1-update1 clr x86 win default
Which is the same as used in my project and local computer. 这与我的项目和本地计算机中使用的相同。
I also looked for the stdout.log from IIS as i also tried setting it up with iis. 我也从IIS寻找stdout.log,因为我也尝试使用iis进行设置。 but no luck.
但没有运气。 And no log is created or can be found.
并且没有日志创建或找不到。
For the record the project.json 记录project.json
{
"webroot": "wwwroot",
"version": "1.0.0-*",
"dependencies": {
"Microsoft.AspNet.Mvc": "6.0.0-rc1-final",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final",
"Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final",
"Swashbuckle.SwaggerGen": "6.0.0-rc1-final",
"Swashbuckle.SwaggerUi": "6.0.0-rc1-final",
"Microsoft.AspNet.Server.WebListener": "1.0.0-rc1-final"
},
"commands": {
"web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5000",
"kestrel": "Microsoft.AspNet.Server.Kestrel",
},
"frameworks": {
"dnx451": {
"dependencies": {
"Microsoft.AspNet.Mvc.ViewFeatures": "6.0.0-rc1-final",
"Microsoft.Extensions.DependencyInjection.Abstractions": "1.0.0-rc1-final"
}
},
"dnxcore50": { }
},
"exclude": [
"wwwroot",
"node_modules",
"bower_components"
],
"publishExclude": [
"node_modules",
"bower_components",
"**.xproj",
"**.user",
"**.vspscc"
]
}
If additional information is required please let me know. 如果需要其他信息,请告诉我。
Not sure why yet, as i assume that a publish will contain everything to be able to run. 不知道为什么,我假设发布将包含所有能够运行的内容。 But.. i found an resolution.
但是..我找到了解决方案。
If you go to the Approot > SRC > ProjectName folder in powershell on the server and run dnu restore.. the web.cmd will suddenly work! 如果转到服务器上Powershell中的Approot> SRC> ProjectName文件夹并运行dnu restore,则web.cmd会突然起作用! As it loads the missing packages!
当它加载丢失的包时!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.