Hi Bill,
Thanks for your feedback.
Yes, System.Reflecti on.Assembly.Get ExecutingAssemb ly().CodeBase should meet
your need, it will return the original assembly location.
However, I think the solution I provided in the last reply should also get
what you want. Once we have used AppDomainSetup. ShadowCopyDirec tories to
get where the assembly is shadown copied from, we can just add the assembly
dll name to this directory to get its original location, this should be the
same as what System.Reflecti on.Assembly.Get ExecutingAssemb ly().CodeBase
returns.
Because Asp.net used shadow copy technology, we can do the test in an
Asp.net application. I print out the different path with the code snippet
below:
private void Page_Load(objec t sender, System.EventArg s e)
{
this.Response.W rite(AppDomain. CurrentDomain.B aseDirectory+"< br>");
this.Response.W rite(AppDomain. CurrentDomain.S hadowCopyFiles. ToString()+"<br >
");
this.Response.W rite(AppDomain. CurrentDomain.S etupInformation .CachePath.ToSt r
ing()+"<br>");
this.Response.W rite(AppDomain. CurrentDomain.S etupInformation .ShadowCopyDire c
tories.ToString ()+"<br>");
this.Response.W rite(System.Ref lection.Assembl y.GetExecutingA ssembly().CodeB a
se+"<br>");
// Put user code to initialize the page here
}
On my machine, the output is:
c:/inetpub/wwwroot/webapp/shadowcopytest/
True
C:\WINDOWS\Micr osoft.NET\Frame work\v1.1.4322\ Temporary ASP.NET
Files\webapp_sh adowcopytest\7a 027e7d
c:\inetpub\wwwr oot\webapp\shad owcopytest\bin
file:///c:/inetpub/wwwroot/webapp/shadowcopytest/bin/shadowcopytest. DLL
As we can see, we can add
AppDomain.Curre ntDomain.SetupI nformation.Shad owCopyDirectori es with the dll
file name to get the original assembly location full path.
Hope this clarify my point.
=============== =============== =============== ==========
Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.