loadFromRemoteSources enabled ="true"// XAML设计师// VS 11 beta和2012 RC

nic*_*las 6 wpf dll cas visual-studio

由此我经常被蜇,当然也总是在最糟糕的时刻.当我编辑xaml文件时,我收到此错误

(System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.)
Run Code Online (Sandbox Code Playgroud)

我在devenv.exe.config中添加了推荐的元素

<configuration>
  <runtime>
    <loadFromRemoteSources enabled="true" />
  </runtime>
</configuration>
Run Code Online (Sandbox Code Playgroud)

应该摆脱它,但对我不起作用.我应该在其他地方添加吗?系统如何首先知道这是从互联网上下载的?我该怎样摆脱那个警告?

Jar*_*rsk 7

我也将XML添加到其他配置文件(XDesProc.exe.config和XDesProc.exe.appx.config),它解决了我的问题:

  1. 转到C:\ Program Files\Microsoft Visual Studio 11.0\Common7\IDE

  2. 使用文本编辑器打开文件XDesProc.exe.config,devenv.exe.config和XDesProc.exe.appx.config(可能需要管理员模式)

  3. 找到</ runtime>之前,添加<loadFromRemoteSources enabled ="true"/>(如果你复制/粘贴,请确保双引号通过,因为ASCII或VS将适合)

(来源:http://www.sehajpal.com/index.php/2010/10/how-to-solve-loadfromremotesources-error-in-vs-2010/)

(类似的问题:WPF设计器无法加载VS 11 beta)