Hi,
I am using ASP.NET 2.0, I need to obtain a reference to
System.Web.Security.CookieProtectionHelper . To do that, I need to load
System.Web.dll. However, this library is already executing and if some how I
can obtain a reference to this library then it might save me a bit of
performance. I am using this code:
Assembly systemWeb = Assembly.LoadWithPartialName("System.Web"); //
PERFORMANCE CONSUMER LINE
Type cookieProtectionHelper =
systemWeb.GetType("System.Web.Security.CookieProtectionHelper");
Any work arrounds to get the running assembly versus loading the static one?

Signature
Adam Tibi
Make it simple, as simple as possible, but not simpler
Mattias Sjögren - 19 Mar 2006 13:57 GMT
>Any work arrounds to get the running assembly versus loading the static one?
The end result is the same, the assembly will only be loaded once. But
one option is
Assembly systemWeb = typeof(AnyTypeInSystemWeb).Assembly;
where AnyTypeInSystemWeb is any public type implemeneted in the
System.Web.
Mattias

Signature
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Adam Tibi - 20 Mar 2006 00:57 GMT
Dear Mattias,
I didn't notice that the assembly will be loaded only once. Thank you for
the tip
Regards

Signature
Adam Tibi
Make it simple, as simple as possible, but not simpler
>
>>Any work arrounds to get the running assembly versus loading the static
[quoted text clipped - 9 lines]
>
> Mattias