How to get rid of security exception?

不问归期 提交于 2019-12-12 03:21:33

问题


I start a .Net server side program on my local workstation, but soon it throws a security exception. I searched the web for answers, but no quick fix was found / worked. I just want to run my program. How do I get rid of the exception? I fully trust the program, because its mine.

Edit: Oh, yes, I do run the program from a mapped folder that is mapped to my own local drive for the sake of clarity of folder structures. Thanks for the answers, I try tomorrow to run it directly from my drive.

Edit: When I use directly my drive, it works.


回答1:


.NET 3.5 SP1 has better support for running applications on the local intranet.

If you can't target 3.5 SP1, you can map the share you're running the application from to a local drive and use CasPol to set that mapped drive to a fully trusted location.




回答2:


As a temporary measure, you can type...

caspol -s off

...and all .NET Code Access Security is suspended (until you hit < enter >).



来源:https://stackoverflow.com/questions/197835/how-to-get-rid-of-security-exception

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!