简体   繁体   English

VS 2013程序包中的扩展WPF工具包:无法加载文件或程序集

[英]Extended WPF Toolkit in VS 2013 Package: Could not load file or assembly

I am developing a Visual Studio 2013 Package. 我正在开发Visual Studio 2013程序包。

I've used NuGet to get the Extended WPF Toolkit and added a CheckComboBox to one of my UserControl . 我使用NuGet来获取Extended WPF Toolkit ,并向我的UserControl之一添加了CheckComboBox

When I debug the VS Experimental Hive, the user control cannot load because an exception is shown in the XAML editor, right before the CheckComboBox declaration. 当我调试VS实验性Hive时,无法加载用户控件,因为XAML编辑器中正好在CheckComboBox声明之前显示了CheckComboBox

The declaration: 声明:

<UserControl
    x:Class="EditorControl"
    xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
    ...
    />

<xctk:CheckComboBox
    Delimiter=";"
    ItemsSource="{Binding ApplicabilityValues}"
    SelectedValue="{Binding Applicability}"
    SelectedItemsOverride="{Binding SelectedItems}"
    />

The exception: 例外:

XamlParseException XamlParseException

A first chance exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll PresentationFramework.dll中发生类型为'System.Windows.Markup.XamlParseException'的第一次机会异常

Additional information: Could not load file or assembly 'Xceed.Wpf.Toolkit, PublicKeyToken=3e4669d2f30244f4' or one of its dependencies. 附加信息:无法加载文件或程序集“ Xceed.Wpf.Toolkit,PublicKeyToken = 3e4669d2f30244f4”或其依赖项之一。 The parameter is incorrect. 参数错误。 (Exception from HRESULT: 0x80070057 (E_INVALIDARG)) (来自HRESULT的异常:0x80070057(E_INVALIDARG))

The inner exception 内部异常

ArgumentException ArgumentException的

The parameter is incorrect. 参数错误。 (Exception from HRESULT: 0x80070057 (E_INVALIDARG)) (来自HRESULT的异常:0x80070057(E_INVALIDARG))

Things I tried so far: 到目前为止,我尝试过的事情:

  • I've added all Extended WPF Toolkit libraries in the .vsixmanifest file as Assets, so now the libraries are added to the solution itself and they are marked with CopyAlways=True and BuildAction=Content , but the exception stays. 我已经在.vsixmanifest文件中将所有Extended WPF Toolkit库添加为Assets,因此现在将库添加到解决方案本身,并用CopyAlways=TrueBuildAction=Content进行标记,但是异常仍然存在。

  • I've cleared the bin/Debug and the C:\\Users\\userName\\AppData\\Local\\Temp folders. 我已经清除了bin/DebugC:\\Users\\userName\\AppData\\Local\\Temp文件夹。

  • I've reseted the VS Experimental Hive enviroment. 我已经重置了VS实验性Hive环境。

Nothing has worked out so far. 到目前为止,什么都没有解决。

What do I have to do to get the Extended WPF Toolkit to work in a Visual Studio 2013 Package? 要使Extended WPF Toolkit在Visual Studio 2013程序包中工作,我该怎么做?

Thanks 谢谢

I fixed this problem by using the attribute [ProvideBindingPath] over my Package class. 我通过在Package类上使用属性[ProvideBindingPath]解决了此问题。

I am not sure about the implications this has with other extensions using Extended WPF Toolkit though. 我不确定这对使用扩展WPF工具包的其他扩展的影响。

I found it thanks to the support from https://wpftoolkit.codeplex.com/discussions/642398#post1437746 我找到了它,这要归功于https://wpftoolkit.codeplex.com/discussions/642398#post1437746的支持

And the stackoverflow link where the attribute was proposed: VSIX - Cannot load file or assembly of a referenced dll 以及提出了该属性的stackoverflow链接: VSIX-无法加载文件或引用的dll的程序集

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM