I am wondering if anyone can help me out with this one. Here goes....... I
have my local machine (Windows XP framework 1.1) and a Server (Windows 2003
framework 1.1). When I go to run my code on my box and late bind to a dll on
the server machine I get an error. Below is the lines of code and the error
I get. I have no problem accessing the Reports.dll so it should not be a
security problem. I get the error when I try to run the class rptBadge. I am
getting a RegistryPermission error. Here is some background on the
class..... I am extending from a class from a 3rd party. We have paid for
the product and I am wondering if it has something to do with that. The
third party might have some information in the registry and I don't have
permissions to read the registry.
Any help would be appreciated.
System.Reflection.Assembly ControlAssembly =
System.Reflection.Assembly.LoadFrom("\\Server1\Reports\output\Reports.dll");
report =
(ProductionActiveReportBase)
ControlAssembly.CreateInstance("Reports.Production.rptBadge");
THE ERROR:
{"Request for the permission of type
System.Security.Permissions.RegistryPermission, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
failed." }
When you load an assembly from a share the assembly falls into the
LocalIntranet code group and gets the LocalIntranet permision set. The
RegistryPermission is not in this permission set so any registry access from
managed code will fail with the exception that you are seeing. There are
various solutions depending on your situation, any of the following would
help:
1. Copy the server assembly to your client and load it from there.
2. Create a custom code group to identify the server assembly (is it
strongly-named?) and assign it more permissions.
3. Get the vendor to modify the code so that it does not need to access the
registry (unlikely I suppose)
There are other solutions but they are a bad idea from a security point of
view.
I hope that one of these will help you.

Signature
Robert Jarratt, MCSD
Microsoft Ltd.
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
> I am wondering if anyone can help me out with this one. Here goes....... I
> have my local machine (Windows XP framework 1.1) and a Server (Windows 2003
[quoted text clipped - 11 lines]
>
> System.Reflection.Assembly ControlAssembly =
System.Reflection.Assembly.LoadFrom("\\Server1\Reports\output\Reports.dll");
> report =
> (ProductionActiveReportBase)
[quoted text clipped - 6 lines]
> Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
> failed." }