VSIX package doesn't include localized resources of referenced assembly
Asked Answered
B

2

4

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...

Barrick answered 7/8, 2011 at 16:55 Comment(0)
Y
5

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
Yearly answered 8/8, 2011 at 5:13 Comment(3)
@Aaron Marten this is still a "bug" in vs 2012 if u try to add a referenced assembly with resources to your VSIX solution. The error is: Microsoft.VsSDK.targets(118,5): error : Could not determine the Full Name of the Assembly at 'resource.txt'Morgenthaler
One thing that is worth mentioning here, it seems that one has to do a full clean and rebuild each time you want to do an reinstall to debug otherwise it goes a bit bonkers...Synergist
Does this only work for project references? Does it only work in VS2010? My extension only uses DLL and NuGet references and I am not seeing "Output Groups Included in VSIX" in the Properties window (VS2019, .NET 4.7.2 VSIX). Plus, some dependencies of a key package (Microsoft.CodeAnalysis.CSharp.Scripting) are included in the VSIX while others are mysteriously left out... and none of the resource assemblies are included.Paulin
G
0

@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.

Guanabara answered 28/2, 2015 at 22:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.