CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    May 2002
    Posts
    121

    security exception System.Security.Permissions

    I need to run an application from a network drive.
    It reads database information and puts it into a datagrid.
    Whenever I click on 'get data' button I get a security exception.

    I looked into System.Security.Permissions on MSDN, but I can't find what I'm looking for.

    Thank you for your help.

  2. #2
    Join Date
    May 1999
    Posts
    24

    Question security exception System.Security.Permission

    Hallo, I read your Problem.
    I have the same problem, too.

    If your have any solution to this problem. Please write it to me.

    Many thanks.

    Gab

    mailto: [email protected]

  3. #3
    Join Date
    Feb 2003
    Location
    Israel
    Posts
    102

    I think it might help:

    Help about this subject from MSDN:

    -----------------------------------------------------------------------------------------------------------
    You attempted to create a project on a UNC path. By default, a UNC path is not a "trusted" location for a project. Your project may not run correctly when you attempt to debug or run from this location.
    For more information, see Configuring Security Policy.
    The following tools modify the policy affecting the file share.
    • .NET Framework Configuration Tool (Mscorcfg.msc)
    • Code Access Security Policy Tool (Caspol.exe)
    Mscorcfg.msc
    One (simple) way to modify the policy affecting a file share is to give a specific file share FullTrust permission using mscorcfg.msc. You must be an administrator on the computer to make this change.
    To give a file share FullTrust permission
    1. Start mscorcfg.msc.
    2. Expand the security node, the Machine node, the Code Groups node, the All_Code node, and then highlight the LocalIntranet_Zone node.
    3. In the right pane select Add a new child code group to this code group.
    4. Choose Create a new Codegroup, then click Next.
    5. Choose a Condition Type of URL, then add the .NET Framework SDK to the share location of your project. Click Next.
    6. Choose Use Existing Permission Set of FullTrust. Click Next.
    7. Select the Exclusive check box. Click Finish.
    8. Right-click the security node, select Save All, and select Yes.
    9. Restart Visual Studio.
    Caspol.exe
    Using caspol.exe to accomplish this change, you would use the following command line (you must be an administrator on the computer to make this change.):
    caspol -m -ag 1.2 -url urlname FullTrust

    -----------------------------------------------------------------------------------------------------------


    I think it might solve the issue.

  4. #4
    Join Date
    Nov 2002
    Location
    Singapore
    Posts
    1,890
    hi

    i have executed .NET exe's over network. I mean the program will be on another maped drive and it will be executed elsewhere. the thing is if the program is using some kind of machine based resources then it will be a problem. if your program is accessing some kind of registery, local resources, local files. which may cause some problems. looks like "underwar" has got most of it. if not you might need to consider full access and looking at remote accessing.

    Paresh

  5. #5
    Join Date
    Mar 2003
    Posts
    17
    If you are using win2k have a look in your administrative tools folder under control panel

    you should see a icon called
    Microsoft .NET Framework Configuration

    there is where you configure your security policys.
    You can be lazy and give full trust to intranet zone..

    or you can be like me and sign all your assemblies with a priivate key and set it up to give full trust to assemblies signed with that particular key.


    There is a .net wizards somewhere where you can trust selected assemblies as well..

  6. #6
    Join Date
    Feb 2003
    Location
    Israel
    Posts
    102

    Talking pareshgh

    what's wrong with my nick?

  7. #7
    Join Date
    Nov 2002
    Location
    Singapore
    Posts
    1,890
    your nick name sounds like you are under war with some one



    Paresh

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured