Permissions & security & vb.Net & my head sick

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

    Permissions & security & vb.Net & my head sick

    hi

    I build a VB .NET application that makes file access, environnemet acess,
    database access, etc....
    If I ran the app locally, everything works....(norma l)

    If I copy the app on a server, and execute it, everything works until a
    file/environnement/database access !.....

    I just want that my app may run in every machine!
    I dont want to use client app like caspol.exe or mscorcfg.msc... (because I
    dont want to execute them in every computer!)

    I found information on FileIOPermissio n, EnvirronementPe rmissionAttribu te,
    .....
    for exemple : <Assembly: FileIOPermissio n(SecurityActio n.RequestMinimu m,
    Unrestricted:=T rue)>
    but nothing works (the program ask me for a debug)


    I also found this code :

    Dim fp As EnvironmentPerm ission
    Try
    fp = New EnvironmentPerm ission(Permissi onState.Unrestr icted)
    fp.Demand()
    Catch e1 As Exception
    MessageBox.Show (e1.Message)
    End Try

    BUT nothing works!
    I have something like :
    System.Security .Permissions.Fi leIOPermission, mscorlib,
    Version=1.0.330 0.0, Culture=neutral , PublicKeyToken= b77a5c561934e08 9
    failed.


    I dont have found info on configuration files such as security.conf or
    machine.conf...
    Is it possible to resolve my problem with that?


    so, my friends, you are my last chance....
    What I must do?

    thanks for your futur response

    lobrys







  • Ed Kaim [MSFT]

    #2
    Re: Permissions &amp; security &amp; vb.Net &amp; my head sick

    If it's loaded locally, then it's fully trusted and can do what you want. If
    it's loaded from a server, it is kept within the Code Access Security
    sandbox. Try going to Start | Administrative Tools | Microsoft .NET
    Framework 1.1 Wizards, and then go through the steps to "Trust an Assembly"
    to let it do whatever it wants. Otherwise you could tweak the permissions so
    that it only lets the app access one specific directory, database, etc.

    "lobrys" <PUTAINlobrysDE @SPAMfreeDE.MER DE.fr> wrote in message
    news:OE7OQKmkDH A.1408@TK2MSFTN GP11.phx.gbl...[color=blue]
    > hi
    >
    > I build a VB .NET application that makes file access, environnemet acess,
    > database access, etc....
    > If I ran the app locally, everything works....(norma l)
    >
    > If I copy the app on a server, and execute it, everything works until a
    > file/environnement/database access !.....
    >
    > I just want that my app may run in every machine!
    > I dont want to use client app like caspol.exe or mscorcfg.msc... (because I
    > dont want to execute them in every computer!)
    >
    > I found information on FileIOPermissio n, EnvirronementPe rmissionAttribu te,
    > ....
    > for exemple : <Assembly: FileIOPermissio n(SecurityActio n.RequestMinimu m,
    > Unrestricted:=T rue)>
    > but nothing works (the program ask me for a debug)
    >
    >
    > I also found this code :
    >
    > Dim fp As EnvironmentPerm ission
    > Try
    > fp = New EnvironmentPerm ission(Permissi onState.Unrestr icted)
    > fp.Demand()
    > Catch e1 As Exception
    > MessageBox.Show (e1.Message)
    > End Try
    >
    > BUT nothing works!
    > I have something like :
    > System.Security .Permissions.Fi leIOPermission, mscorlib,
    > Version=1.0.330 0.0, Culture=neutral , PublicKeyToken= b77a5c561934e08 9
    > failed.
    >
    >
    > I dont have found info on configuration files such as security.conf or
    > machine.conf...
    > Is it possible to resolve my problem with that?
    >
    >
    > so, my friends, you are my last chance....
    > What I must do?
    >
    > thanks for your futur response
    >
    > lobrys
    >
    >
    >
    >
    >
    >
    >[/color]


    Comment

    • lobrys

      #3
      Re: Permissions &amp; security &amp; vb.Net &amp; my head sick

      "Otherwise you could tweak the permissions so that it only lets the app
      access one specific directory, database, etc."

      How can you do that? (in the code?)

      lobrys





      "Ed Kaim [MSFT]" <edkaim@online. microsoft.com> a écrit dans le message de
      news:u5mJ$knkDH A.2364@TK2MSFTN GP11.phx.gbl...[color=blue]
      > If it's loaded locally, then it's fully trusted and can do what you want.[/color]
      If[color=blue]
      > it's loaded from a server, it is kept within the Code Access Security
      > sandbox. Try going to Start | Administrative Tools | Microsoft .NET
      > Framework 1.1 Wizards, and then go through the steps to "Trust an[/color]
      Assembly"[color=blue]
      > to let it do whatever it wants. Otherwise you could tweak the permissions[/color]
      so[color=blue]
      > that it only lets the app access one specific directory, database, etc.
      >
      > "lobrys" <PUTAINlobrysDE @SPAMfreeDE.MER DE.fr> wrote in message
      > news:OE7OQKmkDH A.1408@TK2MSFTN GP11.phx.gbl...[color=green]
      > > hi
      > >
      > > I build a VB .NET application that makes file access, environnemet[/color][/color]
      acess,[color=blue][color=green]
      > > database access, etc....
      > > If I ran the app locally, everything works....(norma l)
      > >
      > > If I copy the app on a server, and execute it, everything works until a
      > > file/environnement/database access !.....
      > >
      > > I just want that my app may run in every machine!
      > > I dont want to use client app like caspol.exe or mscorcfg.msc... (because[/color][/color]
      I[color=blue][color=green]
      > > dont want to execute them in every computer!)
      > >
      > > I found information on FileIOPermissio n,[/color][/color]
      EnvirronementPe rmissionAttribu te,[color=blue][color=green]
      > > ....
      > > for exemple : <Assembly: FileIOPermissio n(SecurityActio n.RequestMinimu m,
      > > Unrestricted:=T rue)>
      > > but nothing works (the program ask me for a debug)
      > >
      > >
      > > I also found this code :
      > >
      > > Dim fp As EnvironmentPerm ission
      > > Try
      > > fp = New EnvironmentPerm ission(Permissi onState.Unrestr icted)
      > > fp.Demand()
      > > Catch e1 As Exception
      > > MessageBox.Show (e1.Message)
      > > End Try
      > >
      > > BUT nothing works!
      > > I have something like :
      > > System.Security .Permissions.Fi leIOPermission, mscorlib,
      > > Version=1.0.330 0.0, Culture=neutral , PublicKeyToken= b77a5c561934e08 9
      > > failed.
      > >
      > >
      > > I dont have found info on configuration files such as security.conf or
      > > machine.conf...
      > > Is it possible to resolve my problem with that?
      > >
      > >
      > > so, my friends, you are my last chance....
      > > What I must do?
      > >
      > > thanks for your futur response
      > >
      > > lobrys
      > >
      > >
      > >
      > >
      > >
      > >
      > >[/color]
      >
      >[/color]


      Comment

      Working...