Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Target "BuiltProjectOutputGroup" does not exist when using <TargetFrameworks> #433

Open
gulbanana opened this issue Nov 27, 2016 · 7 comments
Assignees
Labels
Milestone

Comments

@gulbanana
Copy link

This means that multi-targeting .net core projects cannot be referenced by VSIX projects, which invoke this target to discover what to include in the VSIX. All is well when using a single , but I cannot do that because of #266.

@gulbanana
Copy link
Author

here's a workaround for anyone else in this situation: set <Private>False</Private> on the ProjectReference and then add it manually to VSIXSourceItem

@srivatsn srivatsn added the Bug label Dec 21, 2016
@srivatsn srivatsn added this to the 1.0 RTM milestone Dec 21, 2016
@rynowak
Copy link
Member

rynowak commented Jan 9, 2017

@gulbanana - can you link to an example of the workaround? I've been hit by this as well

@gulbanana
Copy link
Author

not open source, but here are the key changes:

     <ProjectReference Include="..\ReferencedNetCoreProject\ReferencedNetCoreProject.csproj">
       <Project>{d859ea0b-aa17-4d49-8e30-c18a03625116}</Project>
       <Name>ReferencedNetCoreProject</Name>
+      <Private>False</Private>
     </ProjectReference>
+  <Target Name="BeforeBuild">
+    <ItemGroup>
+      <VSIXSourceItem Include="..\ReferencedNetCoreProject\bin\$(Configuration)\DependencyOfTheReferencedProject.dll" />
+    </ItemGroup>
+  </Target>

@rynowak
Copy link
Member

rynowak commented Jan 9, 2017

After applying this workaround, I was still seeing the same error message.

The issue was the lines like:

<Asset Type="Microsoft.VisualStudio.MefComponent" d:Source="Project" d:ProjectName="Some.Other.Project" Path="|Some.Other.Project|" />

in the vsixmanifest.

I changed these to include the outputs of the other projects as content, and then just referenced them as files in the vsixmanifest.

@srivatsn srivatsn modified the milestones: 1.1, 1.0 RTM Jan 27, 2017
@dsplaisted dsplaisted assigned dsplaisted and unassigned nguerrera May 15, 2017
@dsplaisted dsplaisted modified the milestones: 2.0, 1.1 May 15, 2017
@livarcocc livarcocc modified the milestones: 2.1.0, 2.0.0 May 25, 2017
@rainersigwald
Copy link
Member

The "right" fix here would be for the VSIX targets to respect the new metadata we define to specify what TargetFramework to build references for (dependent on the solution to dotnet/msbuild#1276).

Workaround

Right now you can manually specify that in a way that the VSIX collect-reference-outputs mechanism does respect, by specifying AdditionalProperties on the ProjectReference items:

<ProjectReference Include="..\Other\Project.csproj">
  <AdditionalProperties>TargetFramework=net452</AdditionalProperties>
</ProjectReference>

If you want the outputs of multiple TFs, you must specify the ProjectReference multiple times with different metadata.

madskristensen pushed a commit to madskristensen/WebCompiler that referenced this issue Oct 12, 2017
* Makes WebCompiler compatible with .NET CLI version of MsBuild.

* Updates the build configuration to not crash on missing nuspec.

* Don't run "dotnet restore" on whole solution.

* Makes "dotnet restore" run earlier.

* Includes workaround for dotnet/sdk#433.

* Fixes path to WebCompiler.pdb.
ErikEJ added a commit to ErikEJ/SqlCeToolbox that referenced this issue Nov 6, 2017
@jaredpar
Copy link
Member

jaredpar commented Nov 16, 2017

FWIW: In practice I found that @sharwell work around in #1580 is more correct here than @rainersigwald. The Reference often needs both the AdditionalProperties and Name elements in order to succeed. In some cases just AdditionalProperties is enough but have run into cases where both were indeed needed.

jaredpar added a commit to jaredpar/roslyn that referenced this issue Nov 16, 2017
When moving to the new SDK I initially disabled transitive project
references because it was causing issues building our VSIX projects. Had
some time this week to sit down and work through the problem which comes
down to the VSIX indirectly referencing a multi-targetted project. This
is a known bug in the SDK that can be worked around by doing the
following:

- Explicitly referencing the project
- Using AdditionalProperties to specify the TF to use
- Using Name to work around inability of VSSDK to infer Name

The SDK bug is here.

dotnet/sdk#433
@livarcocc livarcocc modified the milestones: 2.1.3xx, Unknown Mar 30, 2018
maikebing added a commit to maikebing/Gitea.VisualStudio that referenced this issue Feb 27, 2019
@rohitsud
Copy link

rohitsud commented Jul 6, 2023

Just wanted to chime in that this is still an issue today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants