VSIX 包不包含引用程序集的本地化资源

发布于 2024-11-28 17:46:03 字数 332 浏览 3 评论 0原文

我正在创建一个 VS2010 扩展(我们称之为 MyExtension)。此扩展的 UI 位于不同的程序集中 (MyExtension.UI),扩展项目仅包含用于从菜单命令调用 UI 的样板代码。

MyExtension.UI 包含本地化资源(例如 fr\MyExtensions.UI.resources.dll),但 VSIX 包不包含这些资源(尽管它们存在于bin\调试目录)。

我应该如何告诉 VS 将这些资源包含在 VSIX 包中?我查看了 .vsixmanifest 设计器,但找不到合适的选项...

I'm creating a VS2010 extension (let's call it MyExtension). The UI for this extension is in a different assembly (MyExtension.UI), the extension project only contains boilerplate code to call the UI from the menu command.

MyExtension.UI contains localized resources (e.g. fr\MyExtensions.UI.resources.dll), but the VSIX package doesn't include these resources (although they are present in the bin\Debug directory).

How should I tell VS to include these resources in the VSIX package? I looked in the .vsixmanifest designer, but I can't find the appropriate option...

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

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

发布评论

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

评论(2

↙厌世 2024-12-05 17:46:03

这实际上是一个错误,将在未来版本中解决。幸运的是,有一个简单的解决方法:

  1. 在解决方案资源管理器中选择“MyExtension.UI”的项目引用节点,然后查看属性 (F4)
  2. 将“VSIX 中包含的输出组”的值更改为以下内容:BuiltProjectOutputGroup;BuiltProjectOutputGroupDependency ;GetCopyToOutputDirectoryItems;SatelliteDllsProjectOutputGroup

This is actually a bug that will be addressed in a future release. Fortunately, there is a simple workaround:

  1. Select the Project Reference node to 'MyExtension.UI' in Solution Explorer and view the Properties (F4)
  2. Change the value for "Output Groups Included in VSIX" to the following: BuiltProjectOutputGroup;BuiltProjectOutputGroupDependencies;GetCopyToOutputDirectoryItems;SatelliteDllsProjectOutputGroup
不念旧人 2024-12-05 17:46:03

@JohnField - 我遇到了同样的错误 - “无法确定'...'处的程序集的全名” - 并且想在此处列出修复程序,以防其他人遇到同样的问题。

我的问题是,我既有对引用程序集的 ProjectReference,又在 .vsixmanifest 文件中将该程序集列为资产。当您将“复制到输出目录”项添加到引用的程序集时,VS SDK 会感到困惑,因为它认为您添加的程序集资源仅适用于该程序集。它看到额外的 CopyToOutputDirectory 项,并认为它是一个程序集并尝试加载它。

解决方法是在 .vsixmanifest 中将程序集作为资产删除。这不是必需的,因为该项目已被引用,其中包括生成的 .vsix 中的程序集。实际上,AssetType 这个不好听的名字“Microsoft.VisualStudio.Assembly”实际上是针对模板向导的。

@JohnField - I ran into the same error - "Could not determine the Full Name of the Assembly at '...'" - and wanted to list the fix here, in case anyone else runs into the same problem.

My issue was that I had both a ProjectReference to the referenced assembly AND I listed the Assembly as an Asset in my .vsixmanifest file. When you add a 'Copy To Output Directory' item to the referenced assembly, the VS SDK gets confused because it thinks the Assembly Asset you added was only for the Assembly. It sees the extra CopyToOutputDirectory item, and thinks it is an assembly and tries to load it.

The fix was to remove the Assembly as an Asset in the .vsixmanifest. This is not needed because the project is already being referenced, which includes the assembly in the resulting .vsix. Actually, the poorly name AssetType “Microsoft.VisualStudio.Assembly” is actually for template wizards.

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