我在 Visual Studio 2010 中打开了第 3 方 XSD 文件,该文件从同一第 3 方的其他架构文件导入命名空间。
在架构文件的 XML 编辑器视图中,xs:import 元素带有下划线,并显示以下错误:请求类型为“System.Security.Permissions.FileIOPermission”的权限,mscorlib,Version=4.0.0.0,Culture=neutral, PublicKeyToken=b77a5c561934e089' 失败。
我阅读了以下博客文章: 链接指出这是安全区域违规,Visual Studio 将架构放置在 XML 架构资源管理器中的“未经授权的区域”中。
我的问题是 - 如何更改安全设置以允许引用这些架构,或者我可以做些什么来使与它们关联的架构和命名空间“受信任”?
I have opened a 3rd party XSD file in Visual Studio 2010 that imports namespaces from other schema files from the same 3rd party.
In the XML editor view of the schema file, the xs:import element is underlined with the following error: Request for the permission of type 'System.Security.Permissions.FileIOPermission', mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
I read the following blog post: Link which states that it's a security zone violation and Visual Studio places the schemas in the "Unauthorized zone" in the XML Schema Explorer.
My question is - how do I change my security settings to allow these schemas to be referenced, or is there something I can do to make the schemas and namespaces associated with them "trusted"?
发布评论
评论(3)
我自己也遇到过这个问题 - 实际上是因为 Win 7 阻止了架构文件,因为它们是从网络位置复制的。
要取消阻止单个文件,请导航到该文件并使用“属性”>“解锁
对于多个文件,最快的方法是使用 Sysinternals 的 Streams 批量更改位置,如所述 在此博文中。
Had this issue myself - it was actually because Win 7 had blocked the schema files due to them being copied in from a network location.
To unblock individual files navigate to the file and use Properties > Unblock
For multiple files it's quickest to use Sysinternals' Streams to bulk change the location as described in this blog post.
使用 Powershell 命令提示符:
https://technet.microsoft.com/en-us/library/hh849924.aspx
Use Powershell command prompt:
https://technet.microsoft.com/en-us/library/hh849924.aspx
我也遇到过同样的情况,就是没有解锁按钮。就我而言,帮助了以下内容
如果Windows策略不允许解锁。
I had the same situation that I did not have unblock button. In my case helped the following
If Windows policy does not allow to unlock.