2012-04-19 30 views
6

這讓我感到非常震驚,當然總是在最糟糕的時刻。 當我編輯XAML文件,我收到此錯誤loadFromRemoteSources enabled =「true」// XAML設計師// VS 11 beta和2012 RC

(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.) 

我加入devenv.exe.config

<configuration> 
    <runtime> 
    <loadFromRemoteSources enabled="true" /> 
    </runtime> 
</configuration> 

recommended元素這是爲了擺脫這一點,但不工作爲了我。 我應該在其他地方添加嗎? 系統如何知道這是從互聯網下載的? 我該如何擺脫這種警告?

回答

7

我加入了XML到其他配置文件,以及(XDesProc.exe.config和XDesProc.exe.appx.config),它解決了這個問題對我來說:

  1. 轉到C:\ PROGRAM FILES \微軟的Visual Studio 11.0 \ Common7 \ IDE

  2. 打開文件XDesProc.exe.config,devenv.exe.config,並使用XDesProc.exe.appx.config文本編輯器(可能需要管理員模式)

  3. 查找</runtime>和bef礦石,添加< loadFromRemoteSources啓用= 「真」/>(如果你複製/粘貼,確保雙引號來通過爲ASCII或VS將會有一個配合)

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

(類似的問題:WPF designer fails to load in VS 11 beta

+0

太晚了50分獎金,但**這**是答案! – nicolas 2012-08-07 07:59:45

0

我能解決這個使用下列步驟:

  1. 轉到這個路徑在Windows資源管理器: C:\ Program Files文件\微軟的Visual Studio 10.0 \ Common7 \ IDE
  2. 打開devenv的。記事本中的exe.config文件或您選擇的任何編輯器。
  3. 搜尋此元素結束標記的文件中:
  4. 這個元素之前關閉標籤,複製並粘貼下面的配置開關
  5. 保存並關閉該配置文件

採取這些步驟從這裏: http://www.sehajpal.com/index.php/2010/10/how-to-solve-loadfromremotesources-error-in-vs-2010/

+2

這與我所做的有什麼不同? – nicolas 2012-08-06 12:52:13

3

這可能是我偶爾遇到的情況,當你粘貼來自不安全來源(互聯網)的文件。無論您正在加載的資源可能被阻止。在Windows資源管理器中,從這些程序集或文件的上下文菜單中選擇Properties。在該對話框的底部,單擊按鈕Unblock(如果可用)。它應該工作。

相關問題