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.

2 Answers 2

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.
Sign up to request clarification or add additional context in comments.

1 Comment

This is the solution really.
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>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.