VSX 2010 包加载 - Markup.xaml 解析找不到程序集

发布于 2024-10-07 22:50:17 字数 2582 浏览 0 评论 0原文

我已经构建了一个 Wpf UserControl 库,它包含一大组程序集,甚至引用了其他两个类库和几个合并的资源字典。它构建没有错误。我构建了一个简单的 VSX 包并引用了 Wpf 库,然后尝试运行它。当它解析页面时,它只能找到我的 xaml UserControl 页面上引用的部分程序集。它在每个不可绑定程序集的融合日志中为我提供了以下错误消息。如果我删除“坏”程序集,它会继续解析到下一个无法找到的程序集。它能够找到我引用的类库之一,但不能找到另一个。它们的设置基本相同,但课程内容不同。

那么,有人有这方面的资源或答案吗?我的其他测试项目甚至包含 WCF 服务,加载时没有任何问题,这对我来说是一个难题。

谢谢,丹尼

=== 预绑定状态信息 === 日志:用户 = AMRS\dhoneycu 日志: DisplayName = System.Windows.Interactivity,PublicKeyToken=31bf3856ad364e35 (部分的) WRN:为程序集提供了部分绑定信息: 警告:程序集名称:System.Windows.Interactivity,PublicKeyToken=31bf3856ad364e35 |域ID:1 警告:当仅提供部分程序集显示名称时,会发生部分绑定。 警告:这可能会导致活页夹加载不正确的程序集。 WRN:建议为程序集提供完全指定的文本标识, WRN:由简单名称、版本、区域性和公钥令牌组成。 警告:请参阅白皮书 http://go.microsoft.com/fwlink/?LinkId=109270 了解更多信息和此问题的常见解决方案。 日志:Appbase = file:///C:/Program Files/Microsoft Visual Studio 10.0/Common7/IDE/ 日志:初始 PrivatePath = NULL

调用程序集:(未知)。

日志:此绑定在默认加载上下文中启动。 日志:使用应用程序配置文件:C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe.Config 日志:使用主机配置文件: 日志:使用 c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\config\machine.config 中的计算机配置文件。 日志:此时策略未应用于引用(私有、自定义、部分或基于位置的程序集绑定)。 日志:尝试下载新的 URL 文件:///C:/Program Files/Microsoft Visual Studio 10.0/Common7/IDE/System.Windows.Interactivity.DLL。 日志:尝试下载新的 URL 文件:///C:/Program Files/Microsoft Visual Studio 10.0/Common7/IDE/System.Windows.Interactivity/System.Windows.Interactivity.DLL。 日志:尝试下载新的 URL 文件:///C:/Program Files/Microsoft Visual Studio 10.0/Common7/IDE/PublicAssemblies/System.Windows.Interactivity.DLL。 日志:尝试下载新的 URL 文件:///C:/Program Files/Microsoft Visual Studio 10.0/Common7/IDE/PublicAssemblies/System.Windows.Interactivity/System.Windows.Interactivity.DLL。 日志:尝试下载新的 URL 文件:///C:/Program Files/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/System.Windows.Interactivity.DLL。 日志:尝试下载新的 URL 文件:///C:/Program Files/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/System.Windows.Interactivity/System.Windows.Interactivity.DLL。 日志:尝试下载新的 URL 文件:///C:/Program Files/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Microsoft/TemplateProviders/System.Windows.Interactivity.DLL。 日志:尝试下载新的 URL 文件:///C:/Program Files/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Microsoft/TemplateProviders/System.Windows.Interactivity/System.Windows.Interactivity.DLL。 日志:尝试下载新的 URL 文件:///C:/Program Files/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/DataCollectors/System.Windows.Interactivity.DLL。 日志:尝试下载新的 URL file:///C:/Program Files/Microsoft Visual Studio

I have built a Wpf UserControl Library and it contains a large group of assemblies and even references two other class libraries and several merged resourceDictionaries. It builds without error. I built a simple VSX package and referenced the Wpf Library, then tried to run it. As it parsed the page it was able to find only part of the assemblies referenced on my xaml UserControl page. It gives me the error message below in the fusion log for each unbindable assembly. If I remove the "bad" assembly it continues parsing to the next unfindable one. It is able to find one of my referenced classlibraries, but not the other. They are set up essentially the same with different class content.

So, does anyone have any resources or answers for this? My other test projects that even contain WCF services load with no issues and this is a stumper for me.

Thanks, Danny

=== Pre-bind state information ===
LOG: User = AMRS\dhoneycu
LOG: DisplayName = System.Windows.Interactivity, PublicKeyToken=31bf3856ad364e35
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: System.Windows.Interactivity, PublicKeyToken=31bf3856ad364e35 | Domain ID: 1
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///C:/Program Files/Microsoft Visual Studio 10.0/Common7/IDE/
LOG: Initial PrivatePath = NULL

Calling assembly : (Unknown).

LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe.Config
LOG: Using host configuration file:
LOG: Using machine configuration file from c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio 10.0/Common7/IDE/System.Windows.Interactivity.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio 10.0/Common7/IDE/System.Windows.Interactivity/System.Windows.Interactivity.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio 10.0/Common7/IDE/PublicAssemblies/System.Windows.Interactivity.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio 10.0/Common7/IDE/PublicAssemblies/System.Windows.Interactivity/System.Windows.Interactivity.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/System.Windows.Interactivity.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/System.Windows.Interactivity/System.Windows.Interactivity.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Microsoft/TemplateProviders/System.Windows.Interactivity.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Microsoft/TemplateProviders/System.Windows.Interactivity/System.Windows.Interactivity.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/DataCollectors/System.Windows.Interactivity.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

所谓喜欢 2024-10-14 22:50:17

您应该在 VSPackage 类上放置 ProvideBindingPath 属性。这将导致探测包程序集所在的目录,以查找否则无法找到的程序集(因为它们不驻留在默认的 VS 探测路径中)。为此,请在项目中包含以下文件:

%VSSDKInstallDir%\VisualStudioIntegration\Common\Source\CSharp\RegistrationAttributes\ProvideBindingPathAttribute.cs

然后,将以下属性添加到 VSPackage 类,如下所示:

[ProvideBindingPath]
公共类 VsPackage1 :包
{
...
}

You should put a ProvideBindingPath attribute on your VSPackage class. This will cause the directory where your package assembly resides to be probed for assemblies that otherwise can't be found (because they don't reside in the default VS probing path). To do so, include the following file in your project:

%VSSDKInstallDir%\VisualStudioIntegration\Common\Source\CSharp\RegistrationAttributes\ProvideBindingPathAttribute.cs

Then, add the following attribute to your VSPackage class like the following:

[ProvideBindingPath]
public class VsPackage1 : Package
{
...
}

蓝眼睛不忧郁 2024-10-14 22:50:17

太感谢了!

我花了一天的大部分时间试图解决这个问题。看起来如果程序集位于 VSIX 包中,那么 Visual Studio 肯定应该找到它,但是查看 Fusion 日志,我很困惑为什么它实际上似乎从未扫描除标准系统位置之外的任何地方。

我想指出的是,在 VS SDK 的更高版本中,ProvideBindingPath 属性包含在 Microsoft.VisualStudio.Shell 命名空间中。

Thank you so much!

I spent the better part of a day trying to figure this out. It seems like if an assembly is in the VSIX package, it should certainly be found by Visual Studio, however looking at the Fusion Log, I was perplexed why it never actually seemed to scan anywhere except the standard system locations.

I want to note that the ProvideBindingPath attribute is included in the Microsoft.VisualStudio.Shell namespace in later versions of the VS SDK.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文