tags:

views:

81

answers:

2

With the demise of Code Access Security, how do we restrict access to a DLL in .Net framework 4.0?

Specifically, we have a project with a UI layer and a business layer. The UI layer tells the business layer who the user is.

What we are trying to stop is any dll other than the UI layer calling the business layer and saying "Hi I am Joe".

+1  A: 

Here's a brief summary on what's been changed and what's been introduced to replace it, as well as how to implement the new features.

Hope it's of some help :

CAS Migration

Jamie Keeling
+2  A: 

Somewhat a partial answer, but you can use the lagacy CAS in .Net 4. Quote from http://www.infoq.com/news/2009/11/CAS-Replaced:

With .NET 4.0, global CAS policies will disabled by default. System administrators are encouraged to use more effective means such as Windows Software Restriction Policies instead. If CAS is actually needed, it can be enabled on a per application basis in the app.config file setting the runtime/NetFx40_LegacySecurityPolicyenabled flag to true.

Mikael Svenson