Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

C# Code Access Security problems.... .Net 3.5

Options
  • 08-02-2008 4:58pm
    #1
    Registered Users Posts: 2,835 ✭✭✭


    Afternoon folks,

    .NET Version: 3.5
    OS: Vista
    IDE: VS.NET 08


    I'm trying to read the directory tree for my local C drive, but i keep getting "UnauthorizedAccessException" for C:\Documents and Settings. I've tried to implement the FileIOPermission imperatively but i'm gettin no joy at all. Is there something i'm missing? I've been googling it all morning with no luck so far. And i cant seem to find "Mscorcfg.msc" with my .net version which might help...

    The program wont even compile in VS.NET 08 unless i change the file path to "Program Files" or some path that doesnt have any protected folders in its sub directories.

    also, Is it better to use imperative or declarative CAS in C#? what choice will make it more usable on XP or another machine without having to go messing around with local settings?


Comments

  • Closed Accounts Posts: 8 Zan


    try compiling the app with a manifest that declares "requireAdministrator" for the requestedExecutionLevel


Advertisement