views:

16

answers:

1

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?

A: 

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

(1) - http://stackoverflow.com/questions/2842208/assemblyresolve-event-is-not-firing-during-compilation-of-a-dynamic-assembly-for

Nariman
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.
Baddie
See the 2nd comment here: http://social.msdn.microsoft.com/forums/en-US/netfxbcl/thread/a3ba76f1-f090-4230-a362-8aa21f34b803/
Nariman