Re: SecurityException

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Wally,

Are you running this assembly from the local machine? If so, are the
settings for that assembly such that you don't have full trust?

Also, does the user that you are running the app under actually have
rights to the file?


--
- Nicholas Paldino [.NET/C# MVP]
- mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx

"Wally Pipp" <wallyhpipp@xxxxxxxxxxx> wrote in message
news:vYeRi.5892$Oy1.5470@xxxxxxxxxxx
Hello All,

I've just inherited a PC with XP, so I loaded VS2005 on it and was running
a
simple windows application when I got a SecurityException just trying to
open a file with the following message:

Request for the permission of type
'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.


When I use the following:

FileStream fs = File.Open(@"C:\txtFiles\File2.txt", FileMode.Open );


I went to Control Panel->Administrative Tools->MS ...Framework 2.0->My
Computer->Runtime Security Policy->Increase Assembly Trust for
mscorlib.dll,
but it didn't help.

Any suggestions?

Thanks,
Wally






----------------------------------------------------------------------------
----
Peek-a-boo FREE Tricks & Treats for You! Get 'em!




.



Relevant Pages

  • Re: SecurityException
    ... Are you running this assembly from the local machine? ... settings for that assembly such that you don't have full trust? ... does the user that you are running the app under actually have ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: XP PRO on 2003 Domain
    ... > when you attempt to open it the local machine just hangs for a long time ... > Also is there a setting on server that will allow ... AD-integrated) DNS server's IP address in their network settings. ... DNS server IPs should be 'seen' by servers or clients in their ipconfig /all ...
    (microsoft.public.windows.server.networking)
  • Re: Machine policy when user logged onto local machine
    ... you log into the domain or local machine. ... then it sounds like domain policy has never propagated to the ... > Interesting point about effective settings. ... > had just been rebooting the client to force it to take the new policy. ...
    (microsoft.public.win2000.security)
  • RE: security alert on macro-enabled worksheet
    ... Microsoft Office Button, ... Click Trust Center, click Trust Center Settings, and then click Message Bar ... I recently had to reinstall Windows on my system, ...
    (microsoft.public.excel.misc)
  • Re: Excel 2007. Trust Access to VBA Project Checked, still not tr
    ... Exactly as you would in any Office application, including Excel. ... Trust access to the VBA project object model ... "Peter T" wrote: ... I've changed the settings to trust ...
    (microsoft.public.excel.programming)