-
I define a custom TFM like so: <!-- This is responsible for allowing us to define our custom native1.0 TFM -->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(TargetFramework)' == 'native1.0'">
<TargetFrameworkIdentifier>Native</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
<TargetFrameworkProfile>Profile1</TargetFrameworkProfile>
</PropertyGroup>
</Project> And the import in my .proj (stripped for convenience) <Import Project="Sdk.props" Sdk="Microsoft.Build.NoTargets" Version="3.7.0" />
<!-- The hook import -->
<Import Project="CustomTargetFrameworkParsingTarget.props"/>
<PropertyGroup>
<TargetFramework>native1.0</TargetFramework>
</PropertyGroup>
<Import Project="Sdk.targets" Sdk="Microsoft.Build.NoTargets" Version="3.7.0" /> This works great, but I can't depend on the outputs of the .proj through a .csproj as it complains about incompatibilities: How could I make my native1.0 TFM compatible with net8.0? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
I'm not sure about custom TFM, but other TFM conflicts can be forced with metadata like this: <ItemGroup>
<ProjectReference Include="../Tool/Tool.csproj">
<SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
<SetTargetFramework>TargetFramework=net462</SetTargetFramework>
</ProjectReference>
</ItemGroup> Perhaps it'd work with NuGet might still have trouble with this, though. NuGet/Home#5154 |
Beta Was this translation helpful? Give feedback.
-
Thanks. That got me in the right direction.
<ProjectReference ReferenceOutputAssembly="False" SetTargetFramework="TargetFramework=native1.0" Include="..\TestProject\TestProject.proj" /> |
Beta Was this translation helpful? Give feedback.
-
Solved with <TargetFramework>native</TargetFramework> and making TestProject a .nativeproj. |
Beta Was this translation helpful? Give feedback.
Solved with
and making TestProject a .nativeproj.
ReferenceOutputAssembly="False"
seems to always be necessary.