Home All Groups Group Topic Archive Search About

Security exception related to network

Author
20 May 2005 1:09 AM
Anwarul@NATSPEC
Hi,

I have written an application in C# which works well in a local machine.
However, it gives me a security exception when I copy the .exe file to a
Windows 2003 server computer in the same network and try to run it from
there. The exception message that it gives me is:

An unhandled exception of type 'System.Security.SecurityException' occurred
in Unknown Module.

Additional information: Request failed.

With some investigation I have discovered that the exception does not occur
if I take off the following line of code from the application:

Process.Start("www.hotmail.com");

I have looked in the MSDN and tried to implement
[SecurityPermissionAttribute()] correctly or incorrectly, but to no avail. I
wonder in .Net is it allowed to install applications in another server
machine across the network within a LAN. Can someone please shed some lights
here?

--
Anwarul Aziz

Author
20 May 2005 9:42 AM
Marinus Holkema
When you run your application local the application is run unther the
My_Computer_Zone Code Group.   This group has default a full trust Permission
Set.

When you run your application from an netweok drive it's run under the Local
Intranet Zone group. This group has restricted permission.

You can manage your permissions with the .NET Configuration Tool found in
Admistrative tools in the control panel

Show quoteHide quote
"Anwarul@NATSPEC" wrote:

> Hi,
>
> I have written an application in C# which works well in a local machine.
> However, it gives me a security exception when I copy the .exe file to a
> Windows 2003 server computer in the same network and try to run it from
> there. The exception message that it gives me is:
>
> An unhandled exception of type 'System.Security.SecurityException' occurred
> in Unknown Module.
>
> Additional information: Request failed.
>
> With some investigation I have discovered that the exception does not occur
> if I take off the following line of code from the application:
>
> Process.Start("www.hotmail.com");
>
> I have looked in the MSDN and tried to implement
> [SecurityPermissionAttribute()] correctly or incorrectly, but to no avail. I
> wonder in .Net is it allowed to install applications in another server
> machine across the network within a LAN. Can someone please shed some lights
> here?
>
> --
> Anwarul Aziz
Author
20 May 2005 6:23 PM
Steve B.
Marinus

Can you take a look at my message posted 5/20/05 on Appl security problems

Steve

Show quoteHide quote
"Marinus Holkema" wrote:

> When you run your application local the application is run unther the
> My_Computer_Zone Code Group.   This group has default a full trust Permission
> Set.
>
> When you run your application from an netweok drive it's run under the Local
> Intranet Zone group. This group has restricted permission.
>
> You can manage your permissions with the .NET Configuration Tool found in
> Admistrative tools in the control panel
>
> "Anwarul@NATSPEC" wrote:
>
> > Hi,
> >
> > I have written an application in C# which works well in a local machine.
> > However, it gives me a security exception when I copy the .exe file to a
> > Windows 2003 server computer in the same network and try to run it from
> > there. The exception message that it gives me is:
> >
> > An unhandled exception of type 'System.Security.SecurityException' occurred
> > in Unknown Module.
> >
> > Additional information: Request failed.
> >
> > With some investigation I have discovered that the exception does not occur
> > if I take off the following line of code from the application:
> >
> > Process.Start("www.hotmail.com");
> >
> > I have looked in the MSDN and tried to implement
> > [SecurityPermissionAttribute()] correctly or incorrectly, but to no avail. I
> > wonder in .Net is it allowed to install applications in another server
> > machine across the network within a LAN. Can someone please shed some lights
> > here?
> >
> > --
> > Anwarul Aziz
Author
23 May 2005 12:41 AM
Anwarul@NATSPEC
hanks for the reply. I have re-set the code access security settings in
Administrative Tools -> .Net FrameWorks Configuration and made it set to full
trust "intranet zone". That solves the problem.


Thank you all for your input.

--
Anwarul Aziz
NATSPEC,
Construction Information Systems
Milsons Point, Sydney.
Australia


Show quoteHide quote
"Marinus Holkema" wrote:

> When you run your application local the application is run unther the
> My_Computer_Zone Code Group.   This group has default a full trust Permission
> Set.
>
> When you run your application from an netweok drive it's run under the Local
> Intranet Zone group. This group has restricted permission.
>
> You can manage your permissions with the .NET Configuration Tool found in
> Admistrative tools in the control panel
>
> "Anwarul@NATSPEC" wrote:
>
> > Hi,
> >
> > I have written an application in C# which works well in a local machine.
> > However, it gives me a security exception when I copy the .exe file to a
> > Windows 2003 server computer in the same network and try to run it from
> > there. The exception message that it gives me is:
> >
> > An unhandled exception of type 'System.Security.SecurityException' occurred
> > in Unknown Module.
> >
> > Additional information: Request failed.
> >
> > With some investigation I have discovered that the exception does not occur
> > if I take off the following line of code from the application:
> >
> > Process.Start("www.hotmail.com");
> >
> > I have looked in the MSDN and tried to implement
> > [SecurityPermissionAttribute()] correctly or incorrectly, but to no avail. I
> > wonder in .Net is it allowed to install applications in another server
> > machine across the network within a LAN. Can someone please shed some lights
> > here?
> >
> > --
> > Anwarul Aziz
Author
20 May 2005 6:23 PM
Steve B.
Anwarul

Can't you compile a VS Release version of your application to your network? 
That's what I do.  Not sure if it's proper though.  maybe somebody can comment

Steve

Show quoteHide quote
"Anwarul@NATSPEC" wrote:

> Hi,
>
> I have written an application in C# which works well in a local machine.
> However, it gives me a security exception when I copy the .exe file to a
> Windows 2003 server computer in the same network and try to run it from
> there. The exception message that it gives me is:
>
> An unhandled exception of type 'System.Security.SecurityException' occurred
> in Unknown Module.
>
> Additional information: Request failed.
>
> With some investigation I have discovered that the exception does not occur
> if I take off the following line of code from the application:
>
> Process.Start("www.hotmail.com");
>
> I have looked in the MSDN and tried to implement
> [SecurityPermissionAttribute()] correctly or incorrectly, but to no avail. I
> wonder in .Net is it allowed to install applications in another server
> machine across the network within a LAN. Can someone please shed some lights
> here?
>
> --
> Anwarul Aziz