473,597 Members | 2,145 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trusting an assembly configuration

I develop software (.NET) with strong name that needs to access network
drives by default.
Is there any way to make sure that this program have network access without
forcing the user to manually add this strong key to be trusted more?
And not to globally trust all .NET applications by default?

You know, to avoid the "Control panel/ Administrative Tools/ Microsoft .NET
Framework Wizards/ Trust an assembly", but during setup automatic configured
instead.

It appears that our users have problems setting up this trust.
Nov 16 '05 #1
3 2217
HI
you can set these security configurations on your assambly manifist
Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC

Nov 16 '05 #2
Hi,
you can set these security configurations on your assambly manifist


Thanks for the reply, but any tips how to set this up? Example or a link to
a page that describes this?
It must be somewhere in the documentation, but first you must find it. ;-)

I am refering to the administative settings that can be configured through
control panel... (policy settings) by user intervention
I am not refering to the settings that the program requests (permissen
settings), because these are already set up in the assembly.cs.

It would be nice if the user must not have to go through control panel
anymore to set up te security settings for my program that needs network
access, and keep his other security settings in place for other programs.
..

Nov 16 '05 #3
> I develop software (.NET) with strong name that needs to access network
drives by default.
Is there any way to make sure that this program have network access without forcing the user to manually add this strong key to be trusted more?
And not to globally trust all .NET applications by default?

You know, to avoid the "Control panel/ Administrative Tools/ Microsoft ..NET Framework Wizards/ Trust an assembly", but during setup automatic configured instead.

It appears that our users have problems setting up this trust.

I have a potentional sollution to my problem.
3 actually, but below is the code that gets my biggest favourite since it
use .NET code.

What I want to have is that my program, with current strong signed key found
in the executable, registers itself as policy that it automaticall have full
trust because it needs access to network drives. How could I modify the code
below that it does this? It could be machine dependend, but it also might be
user dependend.

I prefer to have this registration process into my application and not as
part of the setup program.

But here comes a scary conclusion, if it is possible, then that mean that
any bad program can give itself enoutgh rights to acces the internet without
the user intervention??? Can this be protected by an administrator?

-------------------------------------------
IEnumerator levels = SecurityManager .PolicyHierarch y();
while (levels.MoveNex t()) {
PolicyLevel level = (PolicyLevel)le vels.Current;
//Machine policy?
if (level.Label.To String( ) == "Machine") {
//Start from the Top Level CodeGroup for each Policy Level
CodeGroup group = level.RootCodeG roup;
//Is it for "All code"?
if (group.Membersh ipCondition.ToS tring( ) == "All code"){
//Define the PermissionSet as "FullTrust"
PermissionSet psFulltrust =
level.GetNamedP ermissionSet("F ullTrust");
//Define a URL membership condition for
http://www.contoso.com/bin/*
UrlMembershipCo ndition umc = new
UrlMembershipCo ndition("http://www.contoso.com/bin/*");
//Add the Child CodeGroup - this is what the caspol tool
does for us
//caspol -quiet -machine -addgroup 1. -url
http://www.contoso.com/bin/* FullTrust -name TestCodeGroup
UnionCodeGroup ucg = new UnionCodeGroup( umc,new
PolicyStatement (psFulltrust));
ucg.Name ="DICOM-CT";
group.AddChild( ucg);
//Save the policy
SecurityManager .SavePolicy();
}
}
}
}
Thanks in advance.
Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
8789
by: Terence Shek | last post by:
Is there a way to set the application binding policy so that it always binds to the latest version of an assembly? I'm hoping there is a way to avoid updating the application's binding configuration every time there is an update to a shared assembly.
0
308
by: | last post by:
I develop software (.NET) with strong name that needs to access network drives by default. Is there any way to make sure that this program have network access without forcing the user to manually add this strong key to be trusted more? And not to globally trust all .NET applications by default? You know, to avoid the "Control panel/ Administrative Tools/ Microsoft .NET Framework Wizards/ Trust an assembly", but during setup automatic...
3
2878
by: Florida Coder | last post by:
I have the need to store some application specific configuration data to be used by a class library and or a windows service. I would like to do this in a fashion similar to the way we do with applications and web services without having to use the machine.config file. I know that I could use the code below to do this but the problem then becomes that when using a shared assembly both the assembly and the config file need to be put...
7
10945
by: R Reyes | last post by:
Can someone please explain to me why I can't get the MS Word Interop assembly to work in my VS2005 project? I'm trying to manipulate MS Word from my Web Form application and I can't get passed this screen below. Please help, thanks in advance... Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify...
4
4456
by: =?Utf-8?B?SmFu?= | last post by:
I have a .NET 2.0 application divided in two assemblies; the exe and a dll. The application generates a plugin-dll which is then loaded in a separate AppDomain (along with a second instance of my application dll). It's been working for months and now the it's not working from my application exe anymore but still working from NUnit when testing the dll. What could have changed in my exe? Some configuration thing in my VS2005 project?
1
2244
by: Coaster | last post by:
orig ref here http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/browse_thread/thread/ff29cc370678911d/c0db5b7e3da283b9?lnk=st&q=gac+assembly+new+version&rnum=7#c0db5b7e3da283b9 I have pasted the part I'm interested in below. My company doesn't use versioning or the gac and I'd like to. We're on vs.net 2005 & .net 2., is this still true or has it changed since then? thanks That article is not entirely accurate. ...
7
10315
by: Peter Bradley | last post by:
OK. A bit behind the times, I know; but we're just moving over to .NET 2.0. How on earth do you manage configuration settings in a class library in .NET 2.0? In version 1.1, we used a handy class called AssemblySettings that someone (I forget his name) had written. When the class library was finished, you deployed it to the GAC and put the configuration files in the GAC with the class library assembly. This no longer works. In fact...
7
10818
by: =?Utf-8?B?RG91Z2llIEJyb3du?= | last post by:
Hi I've written custom configuration section (inherits from System.Configuration.ConfigurationSection) to simplify the contents of the config file and to make life easier when accessing them in code. The configuration section is contained within the exe (it's a simple test case!) and everything works well debugging within the IDE or if the application is deployed on a drive or share that has been granted full trust. For the share the...
1
5787
by: Wendi Turner | last post by:
Configuration Error from Visual Studio 2005 .NET 2.0 This is an ASP.NET Website with a Report Viewer Component - Microsoft.ReportViewer.WebForms & .Common included in project output Trying to install on a remote server with websetup project and the error is ... Error(s) on Browse IE: Parser Error Message: Could not load file or assembly
0
1377
balabaster
by: balabaster | last post by:
Hi all, I'm creating a class factory and a bunch of adapters to allow in house applications to communicate with mobile applications over different cellular networks. I've got my class factory and interface definition in a single assembly. The class factory will instantiate the correct adapter for communication with a mobile device at runtime. We're doing it this way because we won't know which cellular network we're communicating over...
0
7965
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7885
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8380
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
5847
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5426
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3881
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3923
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1493
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1231
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.