I have a sample project showing the problem: https://github.com/mastoj/NestDemo/tree/DecoupleHosting
I am doing self hosting in two different ways. First I had it in the NestDemo project, but than I wanted to decouple hosting from application and tried to put the hosting in a separate project, NestDemo.SelfHost. That didn't work since AssemblyAppRoot in RazorViews removes the bin/debug part of the file path which is needed I think if you have the hosting and application separated.