An unhandled exception of type 'System.Security.SecurityException'occurred in system.windows.forms.d

  • Thread starter Thread starter E.T. Grey
  • Start date Start date
E

E.T. Grey

Hi,

I get this everytime I try to run some code I have. I loked it up on
MSDN and was informed that this had something to do with calling
SystemInformation.Username property of System.Windows.Forms.

However, my code does not invoke that method. Any ideas as to why I'm
getting this cryptic message ?
 
E.T. Grey said:
Hi,

I get this everytime I try to run some code I have. I loked it up on
MSDN and was informed that this had something to do with calling
SystemInformation.Username property of System.Windows.Forms.

However, my code does not invoke that method. Any ideas as to why I'm
getting this cryptic message ?

Are you running from a shared drive? Have you trusted the assembly you
are trying to run?

Chris
 
Chris said:
Are you running from a shared drive? Have you trusted the assembly you
are trying to run?

Chris


Shared drive: Yes

"Trusted the Assembly": I'm afreaid I have no idea what this means. This
is sample code from a library manufacturer that I am trying to run. I
downloaded the C# examples from MSDN and was able to run them straight
away (from a shared drive). I don't understand this at all.
 
E.T. Grey said:
Shared drive: Yes

"Trusted the Assembly": I'm afreaid I have no idea what this means. This
is sample code from a library manufacturer that I am trying to run. I
downloaded the C# examples from MSDN and was able to run them straight
away (from a shared drive). I don't understand this at all.

Try moving it to your local drive and see if it works.

or

Goto Administrative Tools -> Microsoft Dotnet Framework Wizard and trust
the assembly. By default you can't run .net code from a share without
stating that you trust it. It's a security thing.

Chris
 
Back
Top