Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

.NET security policy

Status
Not open for further replies.

brd24gor

MIS
May 18, 2005
123
US
I have a program I have recently compiled that I want to put out on our intranet. It works fine on my machine, but if I try to run it from the intranet location, I get an...

"Application tried to perform an operation not allowed by security policy error" System.Security.SecurityException: Request failed

...when the program tries to access it's database(also located on our intranet). I have looked into setting security policy with caspol but I have had zero luck in getting it to work. Here is the command I'm using(taken from MSDN):

Code:
CD %windir%\microsoft.net\framework\v1.1.4322

caspol.exe -polchgprompt off -user -addgroup 1 -allcode Nothing -name "SCBCTesting" -user -addgroup SCBCTesting -url "file:\\scbcmain\data\Testing\SCBCTesting.exe" FullTrust -name "SCBCTesting"
caspol.exe -polchgprompt on

SCBCTesting is my namespace. I'm not sure what "code groups" are so I may be way off.

Can anyone help steer me in the right direction on this? Is there any way this can be done with C# code?

Thanks for any help!
--Brad
 
C# Seems to have issues working off of network drives. If it is copied locally, it works fine.

if you find a solution please let us know!
 
You have the right idea. By default each client machine only want to run apps in the local machine zone. An app on a network share is considered to be in the Internet zone and unsafe. This article may help you.


Jeff
[purple]It's never too early to begin preparing for [/purple]International Talk Like a Pirate Day

I was not born cynical - I earned my cynicism through careful observation of the world around me.
 
Thanks for the page. He does a good job of putting it in layman's terms. I have pretty much determined I have a few options to work with. I can have each client do a local installation(a pain), set each client's .NET security properties for the application(a different kind of pain), or write a .bat script with the caspol command that runs the first time the program is run from that machine(headache coming on...).

Involving the deployment of the app to each local machine, I did come across an interesting idea in the Tek forums. Someone implemented a startup script that checked a database to see if the local computer had the newest version of the program. If not, it copied the newest one to the machine. Not sure how the admin will like that, but a creative solution to mass installations.

Anyone else found other nifty workarounds to these .NET security issues?

Thanks,
--Brad
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top