Groups | Blog | Home
all groups > dotnet security > july 2004 >

dotnet security : Win App SecurityException


Rachel
7/20/2004 2:39:01 PM
Hi All:

I developed my Windows application (Win app NOT Web App) on Win 2000 professional and it works fine on the client computer. Then I attempted to test the application in the NETWORK environment by putting the application out on a network drive when I tried to run it on the client that I developed it on I got an error. I did not write any code for security (I am fresh out of school and I do not know anything about code for security. It was not covered in class and I cannot find it in the books. If that is all I need to do, please provide an example and let me know of any reference I need to set.)

The error is:
"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 security administrator or use the Microsoft.Net security policy administration tool.

Request for the permission of type System.Security.Permission
Security Permission, mscorlib, version=1.0.5000.0, culture=neutral, Public Key Token = b77a5c561934e089 failed."

I have been looking at the MSDN and it is mentioning something about mscorcfg.msc. Do I really need to involve a System Admin to test my app on the network drive or can I just write a little code for permissions for anyone to run it? My app puts data from an Excel spreadsheet into a dataset and then sends it out to a text file. It is not rocket science, but if I do not prove myself I could be out of a job. Please help and be very specific.

Thanks any help is appreciated,

shawnfa NO[at]SPAM online.microsoft.com (
7/21/2004 1:22:53 AM
Hi Rachel,

That's a pretty common problem for people new to .Net to run into. I've posted a blog entry on how to solve it here:
http://blogs.msdn.com/shawnfa/archive/2003/06/20/57023.aspx

If you're an admin on your local machine, you'll be able to grant enough trust to the program in order to allow it to run properly. For
Whidbey, we've done a lot of work to improve the SeucrityException, and debugging in non-FullTrust scenarios, so this will be even easier when
that ships.

-Shawn
http://blogs.msdn.com/shawnfa

--

This posting is provided "AS IS" with no warranties, and confers no rights.
Note: For the benefit of the community-at-large, all responses to this message are best directed to the newsgroup/thread from which they
originated.
--------------------
[quoted text, click to view]
attempted to test the application in the NETWORK environment by putting the application out on a network drive when I tried to run it on the client
that I developed it on I got an error. I did not write any code for security (I am fresh out of school and I do not know anything about code for security.
It was not covered in class and I cannot find it in the books. If that is all I need to do, please provide an example and let me know of any reference I
need to set.)
[quoted text, click to view]
on the network drive or can I just write a little code for permissions for anyone to run it? My app puts data from an Excel spreadsheet into a dataset
and then sends it out to a text file. It is not rocket science, but if I do not prove myself I could be out of a job. Please help and be very specific.
[quoted text, click to view]

AddThis Social Bookmark Button