SecurityException

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Wally Pipp

    #1

    SecurityException

    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 SecurityExcepti on just trying to
    open a file with the following message:

    Request for the permission of type
    'System.Securit y.Permissions.F ileIOPermission , mscorlib, Version=2.0.0.0 ,
    Culture=neutral , PublicKeyToken= b77a5c561934e08 9' failed.


    When I use the following:

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


    I went to Control Panel->Administrati ve 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!


  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: SecurityExcepti on

    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@spam.guard. caspershouse.co m

    "Wally Pipp" <wallyhpipp@hot mail.comwrote in message
    news:vYeRi.5892 $Oy1.5470@trndn y08...
    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 SecurityExcepti on just trying to
    open a file with the following message:
    >
    Request for the permission of type
    'System.Securit y.Permissions.F ileIOPermission , mscorlib, Version=2.0.0.0 ,
    Culture=neutral , PublicKeyToken= b77a5c561934e08 9' failed.
    >
    >
    When I use the following:
    >
    FileStream fs = File.Open(@"C:\ txtFiles\File2. txt", FileMode.Open );
    >
    >
    I went to Control Panel->Administrati ve 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!
    >
    >

    Comment

    • Wally Pipp

      #3
      Re: SecurityExcepti on

      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?
      Hi Nicholas,

      Found the problem. The app was running in a folder that was mapped to one of
      the servers.

      Thanks,
      Wally

      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 SecurityExcepti on just trying to
      open a file with the following message:

      Request for the permission of type
      'System.Securit y.Permissions.F ileIOPermission , mscorlib,
      Version=2.0.0.0 ,
      Culture=neutral , PublicKeyToken= b77a5c561934e08 9' failed.


      When I use the following:

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


      I went to Control Panel->Administrati ve 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!
      >
      >

      Comment

      Working...