提供具有.NET代码访问安全性的映射网络驱动器“ FullTrust”

I'm saving this so I can find it easily later. Chris Sells has a post that describes how to give a Mapped Network Drive "FullTrust." Thanks Chris!

我正在保存它,以便以后可以轻松找到它。 克里斯·塞尔斯(Chris Sells)的帖子描述了如何给映射网络驱动器“ FullTrust”。 谢谢克里斯!

[When loading a Project from a Network Drive (like Z:\, perhaps within a VPC) you may receive:]

[从网络驱动器(例如Z:\,也许在VPC中)加载项目时,您可能会收到:]

The project location is not trusted.
Running the application may result in security exceptions when it
attempts to perform actions which require full trust.

项目位置不受信任。 运行该应用程序时可能会导致安全异常尝试执行需要完全信任的操作。

What's happening is that VS is detecting that the project on the network drive is getting Intranet permissions according to the good and true workings of .NET Code Access Security (CAS). However, since I'm just trying to pretend that Z is on my PC (and, in fact, it is), I want it to have FullTrust permissions.

发生的情况是,VS根据.NET代码访问安全性(CAS)的正常运行情况,检测到网络驱动器上的项目正在获得Intranet权限。 但是,由于我只是想假装Z在我的PC上(实际上是),因此我希望它具有FullTrust权限。

To accomplish this, you need to add a new Code Group with an URL membership permission specifying the folder (in URL form) to which you'd like to grant full trust. You can do with the .NET Framework Configuration tool or you can do it from the command line like so:

为此,您需要添加一个具有URL成员资格许可权的新代码组,该代码组指定要授予其完全信任的文件夹(以URL形式)。 您可以使用.NET Framework配置工具,也可以从命令行执行以下操作:

c:\>caspol -q -machine -addgroup 1 -url file://z:/* FullTrust -name "Z Drive"
Once this new code group is in place, any new .NET processes you start will give any assemblies on the Z drive full trust.

c:\> caspol -q -machine -addgroup 1 -url file:// z:/ * * FullTrust -name“ Z Drive” 一旦有了这个新的代码组,您启动的任何新.NET进程都将完全信任Z驱动器上的所有程序集。

Since awarding new permissions, full trust or not, to any chunk of code is something that can cause a security hole, be careful.

由于授予任何代码块新的权限,无论是否获得完全信任,都会导致安全漏洞,因此请小心。

翻译自: https://www.hanselman.com/blog/giving-a-mapped-network-drive-fulltrust-with-net-code-access-security

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值