Board index » Visual Studio » Deployment Permissions

Deployment Permissions

Visual Studio142
I have built a VB application for distribution and I used the Setup builder

in Visual Studio. I had no problems compiling and installing the

application on two different machines. However on one machine (as luck

would have it...my bosses!) I am getting a .Net security warning that wont

allow a few important features to work.



Basically I am attempting to check for Commandline parameters...it doesn't

like that at all and after displaying the error message it shuts down my

app. If I comment out the check for Commandline parameters, the application

loads and runs until they use the open a directory function which displays

the same error.



I also get the error when attempting to open a connection to SQL Server.



Here is the error text:





"The application attempted to perform an operation not allowed by the

security policy. The operation required the SecurityException. To grant

this application the required permission please contact your system

administrator, or use the Microsoft .Net security policy administrator tool.



Request for the permission of type

System.Security.Permissions.FileIOPermission, mscorlib, version1.0.5000.0,

Culture=neutral, PublicKeyToken=b77a5561934e089 failed."







Thanks for any insight you might be able to offer.

RSH


-
 

Re:Deployment Permissions

Hi,



Try requesting the permission in your code.

http://msdn.microsoft.com/library/default.asp?url" rel="nofollow" target="_blank">msdn.microsoft.com/library/default.asp=/library/en-us/cpref/html/frlrfSystemSecurityPermissionsFileIOPermissionAttributeClassctorTopic.asp



Ken

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

"RSH" <way_beyond_oops@yahoo.com>wrote in message

I have built a VB application for distribution and I used the Setup builder

in Visual Studio. I had no problems compiling and installing the

application on two different machines. However on one machine (as luck

would have it...my bosses!) I am getting a .Net security warning that wont

allow a few important features to work.



Basically I am attempting to check for Commandline parameters...it doesn't

like that at all and after displaying the error message it shuts down my

app. If I comment out the check for Commandline parameters, the application

loads and runs until they use the open a directory function which displays

the same error.



I also get the error when attempting to open a connection to SQL Server.



Here is the error text:





"The application attempted to perform an operation not allowed by the

security policy. The operation required the SecurityException. To grant

this application the required permission please contact your system

administrator, or use the Microsoft .Net security policy administrator tool.



Request for the permission of type

System.Security.Permissions.FileIOPermission, mscorlib, version1.0.5000.0,

Culture=neutral, PublicKeyToken=b77a5561934e089 failed."







Thanks for any insight you might be able to offer.

RSH











-