Results 1 to 9 of 9

Thread: Permissions error

  1. #1
    OMRebel is offline VB.NET Forum Enthusiast
    .NET Framework
    .NET 2.0 (VS 2005)
    Join Date
    Sep 2006
    Posts
    44
    Reputation
    83

    Question Permissions error

    I'm using an Access DB for my app. It runs fine locally, but if I upload it to one of the network drives, I run into an error. I'm not sure how to even begin to approach fixing this.

    When first running the exe off of the network drive, I get this following warning:
    "Microsoft .NET Security Warning - Never enter personal information or passwords into a window unless you can verify and trust the source of the request."

    Then, if I open up a form that attempts to open my DB, I get:
    "Application attempted to perfrom an operation not allowed by the security policy. To grant this application the required permission, contact your system administrator, or use the Microsoft .NET Framework Configuration tool.
    If you click Continue, the application will ignore this error and attempt to continue. If you click Quit, the application will close immediately.
    Request for the permission of type
    'System.Data.OleDb.OleDbPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed."

    The connection string that I use in my code is:
    con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source = profees.mdb"

    Any suggestions?

  2. #2
    Raven65's Avatar
    Raven65 is offline VB.NET Forum Master
    .NET Framework
    .NET 3.5 (VS 2008)
    Join Date
    Oct 2006
    Posts
    305
    Reputation
    114
    Try my post @ the end of this thread.

    http://www.vbdotnetforums.com/showth...tion#post42393

    Your needing to increase the Trust of Network level code if I'm reading you correctly.

  3. #3
    OMRebel is offline VB.NET Forum Enthusiast
    .NET Framework
    .NET 2.0 (VS 2005)
    Join Date
    Sep 2006
    Posts
    44
    Reputation
    83
    That worked perfectly!! Thank you! Thank you!

  4. #4
    cjard's Avatar
    cjard is offline VB.NET Forum All-Mighty
    .NET Framework
    .NET 4.0
    Join Date
    Apr 2006
    Posts
    7,027
    Reputation
    1705
    Incidentally, do be aware that in doing so you increase the trust for all apps running from a network location.. The ramifications of such a move would be analogous to switching off a firewall because it was causing you difficulty in using one app. Be careful..

  5. #5
    superbem is offline VB.NET Forum Newbie
    .NET Framework
    .NET 3.0
    Join Date
    May 2007
    Posts
    22
    Reputation
    76
    There's no way to increase the trust only for my app?

  6. #6
    superbem is offline VB.NET Forum Newbie
    .NET Framework
    .NET 3.0
    Join Date
    May 2007
    Posts
    22
    Reputation
    76
    ok guys, I found this way to add trust to the app run in network:

    in command line:

    caspol.exe -m -ag LocalIntranet_Zone -url
    \\<ServerName>\<FolderName>\* FullTrust -n "<Name>" -d
    "<Description>"

  7. #7
    cjard's Avatar
    cjard is offline VB.NET Forum All-Mighty
    .NET Framework
    .NET 4.0
    Join Date
    Apr 2006
    Posts
    7,027
    Reputation
    1705
    Well, yep.. that fully trusts all apps whose path starts with that.. Its not exactly what you asked, (fully trusting your app only), but its kinda close..

    I could write a .NET app that formats your hard disk, drop it in the same folder as your exe and run it..

  8. #8
    superbem is offline VB.NET Forum Newbie
    .NET Framework
    .NET 3.0
    Join Date
    May 2007
    Posts
    22
    Reputation
    76
    And how do you run a .net app there? I could do that with any vb6 or whatever app running it in any location... Right?

  9. #9
    cjard's Avatar
    cjard is offline VB.NET Forum All-Mighty
    .NET Framework
    .NET 4.0
    Join Date
    Apr 2006
    Posts
    7,027
    Reputation
    1705
    Quote Originally Posted by superbem View Post
    And how do you run a .net app there? I could do that with any vb6 or whatever app running it in any location... Right?
    Any .NET app whose codebase is in that directory or a subdirectory (i.e. that's where the EXE is) is granted FullTrust. To fully trust any assembly, dll, exe etc - just copy it there.

    VB6 apps dont have the concept of runtime security because they are not managed code running inside a virtual machine - they run anywhere at any time, with full trust. Caspol and the other .NET security apps only create permissions for .NET apps

Bookmarks

Posting Permissions

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