我有一个基于ASP.NET 5 RC1 final预览模板的应用程序。我通过运行以下命令来发布此应用程序:
dnu publish --no-source --runtime active --configuration Release
生成的软件包包含运行时“dnx-clr-win-x64.1.0.0-rc1-final”。
当我将软件包复制到另一台Windows机器并尝试在output\approot目录中运行web命令时,会收到以下错误:
Error: Unable to load application or execute command 'Microsoft.AspNet.Server.WebListener'. Available commands: web, webListener.
System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.
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.Host.LoaderContainer.Load(AssemblyName assemblyName)
at Microsoft.Dnx.Runtime.Loader.AssemblyLoaderCache.GetOrAdd(AssemblyName name, Func`2 factory)
at Microsoft.Dnx.Runtime.Loader.LoadContext.ResolveAssembly(Object sender, ResolveEventArgs args)
at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName)
我尝试了Kestrel和WebListener,但出现了相同的错误信息。该程序包在我的电脑上可以运行。
还有其他需要做的事情来使应用程序在另一台计算机上运行吗?
output/bin
文件夹还是其中的一些子文件夹? - Victor Hurdugaci