Add directories to ASP.NET shadow copy via webconf

2019-06-20 02:19发布

问题:

Is there anyway to mark a folder (other than Bin folder) to be shadow copied by adding some configurations in web.config ?

I don't think Application_Start be a good place for setting up AppDomainSetup.ShadowCopyDirectories because at that point AppDomain is already loaded.

回答1:

You are correct once the app domain is created changing the shadow directory location is not possible. You would need to create a separate app domain to point at a different directory. Since bin is shadow copied anyway why not add a sub directory in bin with your additional content ?