没有从mkbundle' d可执行文件加载程序集

时间:2014-04-25 09:43:13

标签: mono servicestack gac mkbundle

我正在使用一堆程序集,包括ServiceStack.Text。在运行mkbundle时,它告诉我它已被嵌入:

embedding: /home/user/Verisys/build/ServiceStack.Text.dll

但是,当我尝试运行生成的可执行文件时,我得到了这个:

Unhandled exception
System.ApplicationException: RootDir '/opt/mono32/lib/mono/gac/ServiceStack.Text/4.0.0.0__e06fbc6124f57c43' for virtual path does not exist
  at ServiceStack.VirtualPath.FileSystemVirtualPathProvider.Initialize () [0x00000] in <filename unknown>:0 
  at ServiceStack.VirtualPath.FileSystemVirtualPathProvider..ctor (IAppHost appHost, System.IO.DirectoryInfo rootDirInfo) [0x00000] in <filename unknown>:0 
  at ServiceStack.VirtualPath.FileSystemVirtualPathProvider..ctor (IAppHost appHost, System.String rootDirectoryPath) [0x00000] in <filename unknown>:0 
  at ServiceStack.ServiceStackHost.Init () [0x00000] in <filename unknown>:0 
  at MyExe.OnStart (System.String[] args) [0x00000] in <filename unknown>:0 

知道它为什么试图从GAC加载这个程序集,而不是使用嵌入式程序集?

1 个答案:

答案 0 :(得分:2)

似乎有一个关于ServiceStack如何提升WebHostPhysicalPath的错误。您可以通过在Configure的{​​{1}}方法中手动指定应用程序的根目录来自行解决此问题:

AppHost