ASP.NET vNext站点无法在IIS下运行

时间:2016-01-07 16:14:10

标签: c# asp.net iis asp.net-core asp.net-core-mvc

我有一个合理标准的网站,我在ASP.NET 5 rc1-update1下构建。我将它部署到IIS(尝试8和7.5)并试图点击它永远不会超过Waiting for localhost阶段。因此,我通过在web.config文件的stdoutLogEnabled="true"元素中设置httpPlatform来启用日志记录,并看到以下错误:

Error: Unable to load application or execute command 'Microsoft.AspNet.Hosting'. Available commands: web, ef.
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 loadContext)
   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)

它似乎无法找到Microsoft.AspNet.Hosting.dll文件。所以我构建了一个测试网站 - 只是默认来自Visual Studio并将其部署到IIS并且运行正常,因此它显然能够找到该文件。

我运行procmon以查看该文件的查找位置,并找到以下内容:

enter image description here

对于我的网站(标记为“失败”),dnx.exe会查找\approot\runtimes,然后放弃。在测试网站中,它也会在\approot\runtimes中查找,无法在那里找到它,但随后它会查看\approot\packages并且它就在那里,网站现在已经启动。

我已经比较了我的网站和测试网站之间的各种配置文件,并且没有看到任何明显的差异或为什么dnx.exe会在\approot\packages中查看测试网站,但不是我的网站。

我错过了什么?如何让dnx.exe在正确的目录中找到DLL?

0 个答案:

没有答案
相关问题