VSIX 包不包含引用程序集的本地化资源
我正在创建一个 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这实际上是一个错误,将在未来版本中解决。幸运的是,有一个简单的解决方法:
BuiltProjectOutputGroup;BuiltProjectOutputGroupDependency ;GetCopyToOutputDirectoryItems;SatelliteDllsProjectOutputGroup
This is actually a bug that will be addressed in a future release. Fortunately, there is a simple workaround:
BuiltProjectOutputGroup;BuiltProjectOutputGroupDependencies;GetCopyToOutputDirectoryItems;SatelliteDllsProjectOutputGroup
@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.