1

I'm mkbundling a bunch of assemblies, including ServiceStack.Text. When running mkbundle, it tells me it's being embedded:

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

However, when I try to run the resulting executable, I get this:

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 

Any idea why it is attempting to load this assembly from the GAC, instead of using the embedded one?

Cocowalla
  • 13,822
  • 6
  • 66
  • 112

1 Answers1

2

There seems to be a bug with how ServiceStack is picking up WebHostPhysicalPath. You may be able to resolve this yourself by manually specifying the root directory of your application in the Configure method of your AppHost:

public override void Configure(Funq.Container container)
{
    Config = new HostConfig {
        WebHostPhysicalPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location),
        ...
    }
}
Scott
  • 21,211
  • 8
  • 65
  • 72
  • This fixed it, thanks! I would never have picked up on that myself! – Cocowalla Apr 25 '14 at 13:11
  • It did not fix my problem. I still have the same issue. Any other answers? – DJ' Aug 20 '14 at 08:34
  • @DeeJay' If you are having a problem then create your own question and provide details of the steps you have taken, and the issue that is occurring. – Scott Aug 20 '14 at 09:38
  • Thanks Scott. I got it solved by upgrading the .net framework (I do not actually remember the version, but its a minor release in the same 4.0) Anyway my problem was the same as described in the question. – DJ' Aug 21 '14 at 13:29