© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
7 replies
Byron

Mixed Project References

Hey Folks,

I often run into the case where I have one project that needs the output from another. For example i have
ProjectA
ProjectA
which is
net8.0
net8.0
and it needs the binaries from
ProjectB
ProjectB
which is compiled using
net48
net48
. I can't add a project reference because they are different runtimes. I have tried to do
<ItemGroup>
  <ProjectReference Include="ProjectB">
    <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
  </ProjectReference>
</ItemGroup>
<ItemGroup>
  <ProjectReference Include="ProjectB">
    <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
  </ProjectReference>
</ItemGroup>

However you get the error
This project may not be fully compatible with your project.
This project may not be fully compatible with your project.
which is weird because it's not a reference. So I add

<ItemGroup>
  <ProjectReference Include="ProjectB">
    <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
    <SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties> <!--- Add this -->
  </ProjectReference>
</ItemGroup>
<ItemGroup>
  <ProjectReference Include="ProjectB">
    <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
    <SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties> <!--- Add this -->
  </ProjectReference>
</ItemGroup>


However the explodes with
doesn't have a target for 'net8.0'
doesn't have a target for 'net8.0'
which is true because it's a
net48
net48
project.

Is there a clean way to set this up without having to do a bunch of MSBuild targets?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

NuGet package project references
C#CC# / help
17mo ago
NetArchTests Not Detecting Project References
C#CC# / help
2y ago
✅ link A project's file to B project which references A project
C#CC# / help
16mo ago
✅ Error while Dockerizing an ASP.NET project which references another project.
C#CC# / help
2y ago