Resolve IAppHost returns null

        var appHost = GetResolver().TryResolve<IAppHost>();
        var path = appHost.VirtualFileSources.RootDirectory.RealPath;

The above code is being run in a Service Post method. appHost is coming back as null. In, I was using GetAppHost() which worked just fine. What else do I need to do to get this working with 4.5.10?

The AppHost isn’t in the IOC, you can get it from:


Or from the Instance singleton in the AppHost:


Which all resolve to the same instance.

1 Like