Permissions & security & vb.Net & my head sick

  • Thread starter Thread starter lobrys
  • Start date Start date
L

lobrys

hi

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

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 FileIOPermission, EnvirronementPermissionAttribute,
.....
for exemple : <Assembly: FileIOPermission(SecurityAction.RequestMinimum,
Unrestricted:=True)>
but nothing works (the program ask me for a debug)


I also found this code :

Dim fp As EnvironmentPermission
Try
fp = New EnvironmentPermission(PermissionState.Unrestricted)
fp.Demand()
Catch e1 As Exception
MessageBox.Show(e1.Message)
End Try

BUT nothing works!
I have something like :
System.Security.Permissions.FileIOPermission, mscorlib,
Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
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
 
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.
 
"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
 
Back
Top