We have a item template that adds one of our DLLs as a reference to the target project. The item can be added to a C# or VB.NET project. I can add the item to a .NET Framework project without any issues. But when I add the item to a .NET 5 project, I get the error "The reference EntityModel could not be added to the project. This wizard will continue to run, but the resulting project may not build properly". I can add the DLL manually to the .NET 5 project without any problems.
<TemplateContent>
<References>
<Reference>
<Assembly>System.Data</Assembly>
</Reference>
<Reference>
<Assembly>EntityModel</Assembly>
</Reference>
</References>
<ProjectItem SubType="" TargetFileName="$fileinputname$.lcm" ReplaceParameters="false" CustomTool="MyModelGenerator">Model.lcm</ProjectItem>
</TemplateContent>
As a test, I did try adding a <HintPath> with a hard coded path to the assembly but that didn't help either.
Any suggestions on what I need to change to avoid getting the error with .NET 5 projects?