Change TargetFramework to net8.0 with inheritance

Updated TargetFramework to inherit from UnrealEngine.csproj.props with a fallback for engines that don't define it.

Also removed the explicit Microsoft.CSharp PackageReference: newer frameworks include it by default and the explicit reference triggers NU1510, which TreatWarningsAsErrors turns into an error.
pull/11/head
kane 3 weeks ago
parent 0f2fd1382f
commit 2aacc96d4a
  1. 6
      SourceCodeGenerator.ubtplugin.csproj

@ -2,7 +2,8 @@
<Import Project="SourceCodeGenerator.ubtplugin.csproj.props" Condition="Exists('SourceCodeGenerator.ubtplugin.csproj.props')" /> <Import Project="SourceCodeGenerator.ubtplugin.csproj.props" Condition="Exists('SourceCodeGenerator.ubtplugin.csproj.props')" />
<Import Project="$(EngineDir)\Source\Programs\Shared\UnrealEngine.csproj.props" /> <Import Project="$(EngineDir)\Source\Programs\Shared\UnrealEngine.csproj.props" />
<PropertyGroup> <PropertyGroup>
<TargetFramework>net8.0</TargetFramework> <!-- Inherit TargetFramework from the engine's UnrealEngine.csproj.props; fallback only for engines that don't define it -->
<TargetFramework Condition="'$(TargetFramework)' == ''">net8.0</TargetFramework>
<Configuration Condition=" '$(Configuration)' == '' ">Development</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Development</Configuration>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath> <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
@ -29,9 +30,6 @@
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType> <DebugType>full</DebugType>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<Reference Include="EpicGames.Build"> <Reference Include="EpicGames.Build">
<HintPath>$(EngineDir)\Binaries\DotNET\UnrealBuildTool\EpicGames.Build.dll</HintPath> <HintPath>$(EngineDir)\Binaries\DotNET\UnrealBuildTool\EpicGames.Build.dll</HintPath>

Loading…
Cancel
Save