开发者

Check permissions of an assembly

开发者 https://www.devze.com 2023-01-13 20:58 出处:网络
I have .Net framework 4.0. It doesn\'t provide the Configuration tool as earlier versions did. With framework 4.0, how do we see 开发者_开发知识库the permissions given to an assembly?Short answer is

I have .Net framework 4.0. It doesn't provide the Configuration tool as earlier versions did.

With framework 4.0, how do we see 开发者_开发知识库the permissions given to an assembly?


Short answer is that "You don't see them anymore".

.NET Framework 4 introduced many changes to the .NET application's security model. Here are two good introductions on the subject:

  • Exploring the .NET Framework 4 Security Model
  • Security Changes in the .NET Framework 4

One of the biggest changes is that the machine-wide policy control has been disabled by default and all the managed code runs as fully trusted by default. Microsoft recommends that instead of using a machine-wide CAS policy, one should look for solutions like Windows Software Restriction Policies. From now on, assemblies' security level should be controller by the host (your application). If one still wants to use the old CAS policy, the following configuration switch provides a legacy security model:

<configuration>
  <runtime>
     <!-- enables legacy CAS policy for this process -->
     <NetFx40_LegacySecurityPolicy enabled="true" />
  </runtime>
</configuration>

So, you don't have to worry about the machine-level assembly permissions anymore when running a .NET Framework 4 software. You use your own application (the host) to control the permissions.

0

精彩评论

暂无评论...
验证码 换一张
取 消