473,396 Members | 1,777 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

.NET Security Exception and .NET policies

Hey All,
When I try and run an application I have installed locally, it works fine. At some point I need to download another dll and run that dll. When I try, this happens:

System.Security.SecurityException: Request for the permission of type 'System.DirectoryServices.DirectoryServicesPermiss ion, System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' failed.


Now if I go to my .NET Framework 2.0 settings in Control Panel -> Administrative Tools -> .Net 2.0 -> Runtime security -> Code groups -> right click properties -> and set "Permission Set" to Fulltrust it works fine.

The issue is I will be installing this application, and I do not want to have to make users set their permission on every machine. Is there a nicer way to handle this, either through code, or by somehow getting the dll's I want to run to not throw a security exception?

Thanks!
Aug 21 '08 #1
5 1162
Plater
7,872 Expert 4TB
If there is I would LOVE to hear it. So far I have not found anyway to do it.
Aug 21 '08 #2
If there is I would LOVE to hear it. So far I have not found anyway to do it.
Yikes...that's what I was hoping not to hear. Would signing the dlls or the application or both somehow make them trusted?

I can see the reason for this, they don't want people being able to download malicious code and execute it, but this also stops a lot of legitimate setups.
Aug 21 '08 #3
Plater
7,872 Expert 4TB
If you can manage to make your ENTIRE application strongly named (that means like no COM objects) then yes I think you can get it to work without changing the default .net security policies
Aug 21 '08 #4
I don't think we are using any COM objects. Atleast that I know of. How can we make this happen?
Aug 21 '08 #5
Plater
7,872 Expert 4TB
I used the wrong lingo earlier (corrected). Strongly Named Assembly is what you are going for I believe.
http://msdn.microsoft.com/en-us/library/wd40t7ad.aspx
Aug 21 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Jack | last post by:
I am working on a dotnet project to write an application that can audit and write registry and local security policy entries on multiple standalone (not networked) and domain computers. Since...
116
by: Mike MacSween | last post by:
S**t for brains strikes again! Why did I do that? When I met the clients and at some point they vaguely asked whether eventually would it be possible to have some people who could read the data...
2
by: Matt Theule | last post by:
Where can I find information about Runtime Security Policies? I have a winform that is hosted in a webform that needs to access the filesystem. Using the Configuration mmc snapin, I have created a...
2
by: Justin | last post by:
I am currently working on a windows app in C# that when given a computer's name needs to check local security policies on that computer across the server. Some of the policies I would like to...
0
by: Usman Shami | last post by:
Hie, I have developed some codes both in C# and VB using CDO and ADO,which work perfectly fine in a windows application, but they donot seem to work in a web services application. I am using...
29
by: Patrick | last post by:
I have the following code, which regardless which works fine and logs to the EventViewer regardless of whether <processModel/> section of machine.config is set to username="SYSTEM" or "machine" ...
1
by: Jason | last post by:
Hi I have a ASP.NET application where i would like to authenticate the connecting users according to the Local Users and Groups on the web server. I have the following code in the ASP.NET...
0
by: abhishek.gilra | last post by:
need to create a function using C# to achieve the following in windows 2k - - Start -Programs -Administrative Tools -Local Security Policy -> Local Policies -Security options. Change...
1
by: starrysky | last post by:
Trying to read key "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" value "AUOptions" and get the following : A first chance exception of type 'System.Security.SecurityException'...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.