P2Ps should be allowed when ReferenceOutputAssembly=false even given TFM incompatibilities
See original GitHub issueWith VS2015 projects, I can have a P2P from a portable library to a net46 library by setting metadata on the project reference:
<ProjectReference Include="..\SomeNet46Lib\lib.csproj">
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
But with the .NET SDK projects, even with this metadata the build fails:
C:\Program Files (x86)\Microsoft Visual Studio\2017\d15rel\MSBuild\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.Sdk.Common.targets(73,5): error : Project ‘C:\git\pinvoke\src\CodeGeneration\CodeGeneration.csproj’ targets ‘.NETFramework,Version=v4.6’. It cannot be referenced by a project that targets ‘.NETPortable,Version=v0.0,Profile=Profile92’. [C:\git\pinvoke\src\CodeGeneration\CodeGeneration.csproj]
This blocks scenarios where a P2P exists merely for the sake of ensuring build ordering but without the assembly reference. In my particular scenario, the referenced project provides a binary that the build of the portable library picks up for code generation purposes.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:14 (13 by maintainers)
Top GitHub Comments
Workaround
Set
in the project that has the
ProjectReference
to the incompatible project. This prevents the elevation of solution build dependencies toProjectReferences
inAssignProjectConfiguration
.(Was poking around near this target for another reason and saw this.)
Yes,
A
is multi-targeted. And that additional metadata did the trick. Thanks.Should we leave the issue active for making this scenario simpler, and/or work the way it used to?