Add directories to ASP.NET shadow copy
Asked Answered
F

1

3

In my ASP.NET app, I'm attempting to add another directory to be have the DLLs in it shadow copied.

The only method I found that will allow m to do this is AppDomain.CurrentDomain.SetShadowCopyPath.

However, this method is marked as Obsolete. MSDN has this to say about it

SetShadowCopyPath(String path) Message: AppDomain.SetShadowCopyPath has been deprecated. Please investigate the use of AppDomainSetup.ShadowCopyDirectories instead.

However, the AppDomainSetup.ShadowCopyDirectories property doesn't seem to change whenever I set a value to it.

AppDomain.CurrentDomain.SetupInformation.ShadowCopyDirectories = "mydirectory;bin";
string test = AppDomain.CurrentDomain.SetupInformation.ShadowCopyDirectories; // returns bin, which was the original directory

Is there a reason that it won't change and is there a work around?

Florey answered 30/10, 2010 at 20:26 Comment(0)
S
0

The paths need to be absolute - and I would set this early on in Application_Start (1).

(1) - AssemblyResolve event is not firing during compilation of a dynamic assembly for an aspx page

Siding answered 31/10, 2010 at 20:20 Comment(2)
The answer in the link you gave uses SetShadowCopyPath(String path). I tried that and it works. But I want to know if there is a non-obsolete method I can use.Florey
See the 2nd comment here: social.msdn.microsoft.com/forums/en-US/netfxbcl/thread/…Siding

© 2022 - 2024 — McMap. All rights reserved.