由于Fluent DLL,无法查看VS2013设计器
本文关键字:VS2013 Fluent DLL 由于 | 更新日期: 2023-09-27 18:04:42
首先,让我说,是的,我做了一些研究。但现在我只是很沮丧。
C: ' ' '用户微软AppData '当地' ' VisualStudio ' 12.0 '设计' ShadowCache ' didkffin.1gk ' ecny11ys.s1u ' Fluent.dll试图从网络位置加载程序集,这可能会导致程序集在以前版本的。net框架中被沙盒化。. net框架的这个版本默认情况下不启用CAS策略,所以这个负载可能是危险的。如果此加载不打算沙箱程序集,请启用loadFromRemoteSources开关。详见http://go.microsoft.com/fwlink/?LinkId=155569
所以很明显这不是一个网络位置…搞什么鬼?
我试过右键单击DLL并单击取消阻塞。它只是用DLL的副本创建一个新的临时目录。
我已经设置为嵌入互操作类型。那也不行。我将复制到本地设置为false。这也没用。
我已经把这段代码放到了App.Config文件
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1"/>
</startup>
<runtime>
<loadFromRemoteSources enabled="true"/>
</runtime>
<system.diagnostics>
<sources>
<source name="System.Windows.Data" switchName="SourceSwitch">
<listeners>
<remove name="Default" />
</listeners>
</source>
</sources>
</system.diagnostics>
</configuration>
但我仍然有这个问题。
Mainwindow.xaml
<Fluent:MetroWindow x:Class="Enterprise.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Fluent="clr-namespace:Fluent;assembly=Fluent"
Title="MainWindow" Style="{DynamicResource MetroWindowStyle}">
<Grid>
</Grid>
</Fluent:MetroWindow>
Mainwindow.xaml.cs
using Fluent;
namespace Enterprise
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : MetroWindow
{
public MainWindow()
{
InitializeComponent();
}
}
是程序集已加载。
These two errors exists even tho the project compiles and runs
Error 1 The name "MetroWindow" does not exist in the namespace "clr-namespace:Fluent;assembly=Fluent".
Error 2 The type 'Fluent:MetroWindow' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.
我难住了。有人能帮忙吗?
对于任何可能遇到此问题的人,我已经解决了它。
步骤1:删除项目中的引用。
步骤2:重命名obj文件夹
步骤3:打开.proj文件。查找引用,它看起来像这样。
<Reference Include="Fluent, Version=2.1.0.0, Culture=neutral, PublicKeyToken=3e436e32a8c5546f, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..'Dev'Assets'Ribbon'Fluent.dll</HintPath>
</Reference>
和
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..'Dev'Assets'Ribbon'System.Windows.Interactivity.dll</HintPath>
</Reference>
从文件中删除这两个。这就是整个标签
步骤4:重新启动Visual studio。第五步:重新添加引用