Missing "BuiltProjectOutputGroupDependencies" building VSIX depending on new simplified csproj
Asked Answered
A

2

8

I have a standard VSIX project taking a project dependency on a class library project in the same solution. Everything was building just fine until I switched the class library to the new VS2017RC simplified csproj. The class library builds fine (my dotnet SDK is 1.0.0-preview4-004233), but when trying to build the VSIX I get:

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

This obviously looks like an incompatibility with a traditional VSIX csproj expecting something from dependent projects that the new csproj doesn't provide.

Has anyone bumped into this or have any advice on working around it? I'm going to look into removing the project reference and manually referencing the output DLL.

As a related side note, it's unclear which output DLL the VSIX would select from the class library, as the new csproj supports multiple target frameworks.

Asphalt answered 24/1, 2017 at 15:35 Comment(0)
N
9

As stated on the GitHub issue, here's a workaround:

  1. Unload the VSIX project.
  2. Right-click and edit its .csproj file.
  3. Find the <ProjectReference> to the project which started causing the issue.
  4. Add the element <AdditionalProperties>TargetFramework=net452</AdditionalProperties>, using the correct .NET Framework version you target in the referenced project.
  5. Reload and rebuild the VSIX proejct.
Nl answered 11/10, 2017 at 23:37 Comment(1)
This is the solution really.Expressway
T
0

I believe you may be encountering the same issue I had when I tried to reference my Visual Studio Extension from a .NET Standard library that was targeting multiple frameworks. There is a GitHub issue dotnet/sdk#433 about it.

What I had to do was remove my other targets. In my case, I had:

<Project Sdk="Microsoft.NET.Sdk">
    <PropertyGroup>
        <TargetFrameworks>netstandard1.3;net46</TargetFrameworks>
    </PropertyGroup>    
    ...
</Project>

And I had to modify it to only target netstandard1.3 (since it is compatible with .NET 4.6 according to the .NET Standard chart) and my VSIX targets .NET 4.6.

<Project Sdk="Microsoft.NET.Sdk">
    <PropertyGroup>
        <TargetFramework>netstandard1.3</TargetFramework>
    </PropertyGroup>  
    ...
</Project>
Territorialism answered 18/4, 2017 at 20:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.