Home All Groups Group Topic Archive Search About

IE C# ActiveX without permissons

Author
9 Nov 2006 5:45 PM
Brutus
Hi, I'm porting a VB ActiveX to C# .Net. The C# ActiveX is called from
IE as following:

<OBJECT id="myControl1" name="myControl1"
classid="ClassLibrary1.dll#ClassLibrary1.Class2" width="0" height="0">
</OBJECT>

The class is created and runs Ok until the following line

string path = Path.GetTempPath() + "Executable.exe";

Where it throws an Exception message like this:

"Request of the permission of type '
System.Security.Permissions.EnvironmentPermission, mscorlib,
Versino=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5....'  failed"

What I have to do to grant the correct permissions for the assembly?

Thanks

Mauro Asprea

Author
13 Nov 2006 11:14 PM
Nicole Calinoiu
See http://blogs.msdn.com/shawnfa/archive/2003/06/20/57023.aspx for a
general explanation of the issue and
http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx for some
additional details that are pertinent to IE-hosted assemblies.


Show quoteHide quote
"Brutus" <mauroasp***@gmail.com> wrote in message
news:1163094357.255115.280120@b28g2000cwb.googlegroups.com...
> Hi, I'm porting a VB ActiveX to C# .Net. The C# ActiveX is called from
> IE as following:
>
> <OBJECT id="myControl1" name="myControl1"
> classid="ClassLibrary1.dll#ClassLibrary1.Class2" width="0" height="0">
> </OBJECT>
>
> The class is created and runs Ok until the following line
>
> string path = Path.GetTempPath() + "Executable.exe";
>
> Where it throws an Exception message like this:
>
> "Request of the permission of type '
> System.Security.Permissions.EnvironmentPermission, mscorlib,
> Versino=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5....'  failed"
>
> What I have to do to grant the correct permissions for the assembly?
>
> Thanks
>
> Mauro Asprea
>
Author
16 Nov 2006 5:16 PM
Brutus
Thanks! I read the entire thread but now I'm a bit confused. It's
possible or not to have the required permissions to execute the .Net
Assembly without change anything on the client side??
I don't understand why in VB the permissions are granted  for the Win32
GetTempPath and not for .Net??

On 13 nov, 20:14, "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT
com> wrote:
Show quoteHide quote
> Seehttp://blogs.msdn.com/shawnfa/archive/2003/06/20/57023.aspxfor a
> general explanation of the issue andhttp://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspxfor some
> additional details that are pertinent to IE-hosted assemblies.
>
> "Brutus" <mauroasp***@gmail.com> wrote in messagenews:1163094357.255115.280***@b28g2000cwb.googlegroups.com...
>
> > Hi, I'm porting a VB ActiveX to C# .Net. The C# ActiveX is called from
> > IE as following:
>
> > <OBJECT id="myControl1" name="myControl1"
> > classid="ClassLibrary1.dll#ClassLibrary1.Class2" width="0" height="0">
> > </OBJECT>
>
> > The class is created and runs Ok until the following line
>
> > string path = Path.GetTempPath() + "Executable.exe";
>
> > Where it throws an Exception message like this:
>
> > "Request of the permission of type '
> > System.Security.Permissions.EnvironmentPermission, mscorlib,
> > Versino=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5....'  failed"
>
> > What I have to do to grant the correct permissions for the assembly?
>
> > Thanks
>
> > Mauro Asprea