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?

Omar
  • 39,496
  • 45
  • 145
  • 213

1 Answers1

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

Community
  • 1
  • 1
Nariman
  • 6,368
  • 1
  • 35
  • 50
  • 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. – Omar Oct 31 '10 at 20:54
  • See the 2nd comment here: http://social.msdn.microsoft.com/forums/en-US/netfxbcl/thread/a3ba76f1-f090-4230-a362-8aa21f34b803/ – Nariman Oct 31 '10 at 21:08