2
votes

I am attempting to create a Visual Studio VSIX extension, and I'm running into an issue when compiling with 3 "Dependencies" that are C# class libraries in the same solution:

error MSB4057: The target "VSIXContainerProjectOutputGroup" does not exist in the project.

error MSB4057: The target "VSIXContainerProjectOutputGroup" does not exist in the project.

error MSB4057: The target "VSIXContainerProjectOutputGroup" does not exist in the project.

All three assemblies are set to "Embed in this VSIX" and the embed folder is set to "/"; here is the XML in the "source.extension.vsixmanifest" file:

<Dependencies>
    <Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="4.6" d:InstallSource="Download" />
    <Dependency d:Source="Project" d:ProjectName="Networking" d:InstallSource="Embed" Version="0.5" Location="|Networking;VSIXContainerProjectOutputGroup|" DisplayName="|Networking;VSIXNameProjectOutputGroup|" Id="|Networking;VSIXIdentifierProjectOutputGroup|" d:VsixSubPath="/" />
    <Dependency d:Source="Project" d:ProjectName="Utilities" d:InstallSource="Embed" Location="|Utilities;VSIXContainerProjectOutputGroup|" DisplayName="|Utilities;VSIXNameProjectOutputGroup|" Id="|Utilities;VSIXIdentifierProjectOutputGroup|" d:VsixSubPath="/" />
    <Dependency d:Source="Project" d:ProjectName="Data Model" Version="1.0" d:InstallSource="Embed" d:VsixSubPath="/" Location="|Data Model;VSIXContainerProjectOutputGroup|" DisplayName="|Data Model;VSIXNameProjectOutputGroup|" Id="|Data Model;VSIXIdentifierProjectOutputGroup|" />
  </Dependencies>

This code needs to be in separate assemblies so that it can be referenced by other projects.

I already tried both suggestions mentioned in this MSDN forum question, and neither worked.

There is another less troublesome but possibly relevant problem that is happening: every once in a while, the classes and namespaces in these three projects seem to disappear, and I have to remove and re-add the references to them.

Any help fixing these problems would be greatly appreciated; please let me know if I can provide any other information to help solve them.

EDIT

I tried recompiling in Release mode to see if it was a configuration-specific problem, but nothing changed.

2

2 Answers

5
votes

I managed to fix it by removing the lines that specify OutputGroupsIncludedInVSIX and OutputGroupsIncludedInVSIXLocal for the project references in the csproj file of the extension project, and changing the libraries to be "Assets" instead of "Dependencies" in the vsixmanifest file.

Hopefully this helps other people with the same issue.

0
votes

If any of the dependencies are multi target .NET core framework libraries (i.e. netstandard2.0;net462) in VS2017 and you get this error:

Error: c:\path\to\depproj.csproj : error MSB4057: The target "BuiltProjectOutputGroupDependencies" does not exist in the project

Add this:

<AdditionalProperties>TargetFramework=net462</AdditionalProperties>

To the .csproj file in the project reference node as an additional property.

<ProjectReference Include="..\path\to\deprpoj.csproj">
    <Project>{81eab942-30aa-445e-86d6-ad6becdf804c}</Project>
       <Name>Your.Project.Name</Name>   
    <AdditionalProperties>TargetFramework=net462</AdditionalProperties>
</ProjectReference>