.net 2.0安全配置

发布于 2024-07-10 01:13:27 字数 524 浏览 6 评论 0原文

是否有一些帮助资源,或者任何人都可以给我一个简短的想法,我将如何为以下场景配置 .net 2 运行时安全策略:

我有一个托管在 IE 中的 Windows 窗体控件。 该控件尝试从串行端口读取数据并写入事件日志。 由于浏览器中的安全限制,这两个操作都失败:

请求“System.Security.Permissions.SecurityPermission,mscorlib, Version=2.0.0.0, Culture=neutral,PublicKeyToken=b77a5c561934e089”类型的权限失败。

请求“System.Diagnostics.EventLogPermission,System,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089”类型的权限失败。

我已将我的网站添加到 IE 中完全受信任的网站列表中,将其设置为完全受信任,但问题仍然存在。 我很确定答案就在 .net 2.0 配置中的运行时安全策略中,但我只是不知道要更改什么。

Are there some help resources, or can anyone give me a brief Idea how I would configure the .net 2 runtime security policies for the following scenario:

I have a windows forms control hosted in IE. The control tries to read from a serial port and write to the event log. Both of these operations fail due to security restrictions in the browser:

Request for the permission of type 'System.Security.Permissions.SecurityPermission,mscorlib, Version=2.0.0.0, Culture=neutral,PublicKeyToken=b77a5c561934e089 failed.

Request for the permission of type 'System.Diagnostics.EventLogPermission,System, Version=2.0.0.0, Culture=neutral,PublicKeyToken=b77a5c561934e089 failed.

I've set my site to be fully trusted by adding it to the list of fully trusted sites in IE, but I still have the problem. I am pretty sure the answer isin the runtime security policies in the .net 2.0 configuration but I just don't know what to change.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

猫七 2024-07-17 01:13:27

请尝试以下操作:

控制面板 -> 管理工具 -> Microsoft .NET Framework 2.0 配置

展开并选择:

.Net Framework 2.0 配置 -> 我的电脑-> 运行时安全策略-> 机器-> 代码组 -> All_Code

下面有不同的区域。 我不确定哪一个适用于 IE 和您的场景,但请在每个选项上尝试以下操作(记住在测试后将它们设置回来)

右键单击“??????_Zone”
选择“权限集”选项卡
将“权限集”组合更改为“完全信任”。

“成员资格权限”选项卡也可能提供一些线索来判断哪一个是正确的。

有关代码访问安全的信息

Try the following:

Control Panel -> Administrative Tools -> Microsoft .NET Framework 2.0 Configuration

Expand out and select:

.Net Framework 2.0 Configuration -> MyComputer -> Runtime Security Policy -> Machine -> Code Groups -> All_Code

Under that there are the different zones. I'm not sure which one would apply to IE and your scenario, but try the following on each of them (remember to set them back after testing)

Right click on the "??????_Zone"
Select the "Permission Set" Tab
Change the "Permission Set" combo to "Full Trust"

The "Membership Permission" tab may also lend some clues to which one is correct.

Info on Code Access Security

她说她爱他 2024-07-17 01:13:27

由于(我假设)您在 IIS 下运行,因此您需要确保您的 I_USRmachinename 帐户位于具有您所需权限的安全组中,或者它不在像“Guests”这样的组中,该组会限制访问系统事件日志等内容。 查看您尝试运行的系统上的 I_USR、I_WAM 和 ASP.NET 帐户的权限/组。 我认为这就是你的问题所在。

Since (I assume) you're running under IIS, you need to make sure that your I_USRmachinename account is in a security group that has the permissions you need, or that it is not in a group like "Guests," which would have restricted access to things like the system Event Log. Look at the permissions/groups for your I_USR, I_WAM, and ASP.NET accounts on the system you're trying to run on. I think that's where your problem lies.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文