Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.NET8 upgrade #1452

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
Releases, starting with 9/2/2021, are listed with the most recent release at the top.
# NuGet Version 0.105.1

__Breaking Changes__:

.NET 6.0 is no longer supported. Due to .NET 7 reaching end of support soon, .NET 8.0 is now the minimum version. For .NET FX version support is still the same: 4.7.2 and higher.

__Bug Fixes__:

#1426 Sequential.eval() does not put model into eval mode<br/>
Expand Down
8 changes: 4 additions & 4 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
name: Ubuntu_x64
# This reports the GLIB_ and GLIBCXX_ dependencies on the system which ends up getting baked into
# the generated libTorchSharp.so (and partly determines which Linux systems that binary will
# be usable on), then installs clang-7.0 (LibTorch likes this for building C++ 14), then installs .NET 6.0
# be usable on), then installs clang-7.0 (LibTorch likes this for building C++ 14), then installs .NET 8.0
prepScript: ${{ variables.LinuxPrepScript }}
buildScript: dotnet build /p:SkipCuda=true -c
testScript: dotnet test /p:SkipCuda=true --blame test/TorchSharpTest/TorchSharpTest.csproj -c
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
displayName: 'Use .NET Core sdk'
inputs:
packageType: sdk
version: 6.0.402
version: 8.x
installationPath: $(Agent.ToolsDirectory)/dotnet

- script: ${{ variables.LinuxPrepScript }}
Expand Down Expand Up @@ -151,7 +151,7 @@ jobs:
displayName: 'Use .NET Core sdk'
inputs:
packageType: sdk
version: 6.0.402
version: 8.x
installationPath: $(Agent.ToolsDirectory)/dotnet

- script: dotnet build -c $(BuildConfig) src/Redist/libtorch-cpu/libtorch-cpu.proj /p:UpdateSHA=true /p:SkipTests=true /p:TargetOS=windows /t:Build /p:IncludeLibTorchCpuPackages=true
Expand Down Expand Up @@ -421,7 +421,7 @@ jobs:
displayName: 'Use .NET Core sdk'
inputs:
packageType: sdk
version: 6.x
version: 8.x
installationPath: $(Agent.ToolsDirectory)/dotnet

- script: ${{ variables.LinuxPrepScript }}
Expand Down
2 changes: 1 addition & 1 deletion build/ci/job-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
displayName: 'Use .NET Core sdk'
inputs:
packageType: sdk
version: 6.x
version: 8.x
installationPath: $(Agent.ToolsDirectory)/dotnet
- script: $(_prepScript)
displayName: Install build dependencies
Expand Down
7 changes: 0 additions & 7 deletions global.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<WarningsNotAsErrors>CS8981</WarningsNotAsErrors>
<NoBuild>false</NoBuild>
<!-- The Directory.Build.props initialize TargetFrameworks to multiple targets. We have to clear that out to set only the targets we support. -->
<TargetFrameworks></TargetFrameworks>

<TargetFrameworks Condition="'$(SkipNetCoreBuild)' != 'true'">net6.0</TargetFrameworks>
<TargetFrameworks Condition="'$(SkipNetCoreBuild)' != 'true'">net8.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT' And '$(SkipNetFxBuild)' != 'true'">net472;$(TargetFrameworks)</TargetFrameworks>
<TargetFrameworks Condition="'$(TargetFrameworks)' == ''">net6.0</TargetFrameworks>
<TargetFrameworks Condition="'$(TargetFrameworks)' == ''">net8.0</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down
1 change: 1 addition & 0 deletions pkg/FileRestitcher/FileRestitcher/FileRestitcher.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<WarningsNotAsErrors>CS8981</WarningsNotAsErrors>
<NoBuild>false</NoBuild>
<OutputType>Library</OutputType>
<TargetFramework>netstandard2.0</TargetFramework>
Expand Down
8 changes: 4 additions & 4 deletions pkg/TorchAudio/TorchAudio.nupkgproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Pack">

<PropertyGroup>
<TargetFrameworks>net6.0;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net8.0;netstandard2.0</TargetFrameworks>
<PackageDescription>.NET Bindings for TorchAudio. Requires reference to TorchSharp and one of libtorch-cpu, libtorch-cuda-$(CudaVersionDot), libtorch-cuda-$(CudaVersionDot)-win-x64 or libtorch-cuda-$(CudaVersionDot)-linux-x64 version $(LibTorchPackageVersion) to execute.</PackageDescription>
</PropertyGroup>

Expand All @@ -10,9 +10,9 @@
</ItemGroup>

<ItemGroup>
<Content Include="..\common\NormalPackage.props" Pack="true" PackagePath="buildTransitive\net6.0\$(MSBuildProjectName).props" />
<Content Include="..\common\NormalPackage.targets" Pack="true" PackagePath="buildTransitive\net6.0\$(MSBuildProjectName).targets" />
<Content Include="..\empty.txt" Pack="true" PackagePath="lib\net6.0\_._" />
<Content Include="..\common\NormalPackage.props" Pack="true" PackagePath="buildTransitive\net8.0\$(MSBuildProjectName).props" />
<Content Include="..\common\NormalPackage.targets" Pack="true" PackagePath="buildTransitive\net8.0\$(MSBuildProjectName).targets" />
<Content Include="..\empty.txt" Pack="true" PackagePath="lib\net8.0\_._" />
<Content Include="..\common\NormalPackage.props" Pack="true" PackagePath="buildTransitive\netstandard2.0\$(MSBuildProjectName).props" />
<Content Include="..\common\NormalPackage.targets" Pack="true" PackagePath="buildTransitive\netstandard2.0\$(MSBuildProjectName).targets" />
<Content Include="..\empty.txt" Pack="true" PackagePath="lib\netstandard2.0\_._" />
Expand Down
12 changes: 6 additions & 6 deletions pkg/TorchSharp-cpu/TorchSharp-cpu.nupkgproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net8.0;netstandard2.0</TargetFrameworks>
<PackageDescription>TorchSharp makes PyTorch available for .NET users. This package combines the TorchSharp package with LibTorch $(LibTorchVersion) CPU support.</PackageDescription>
</PropertyGroup>

Expand All @@ -10,13 +10,13 @@
<ProjectReference Include="..\libtorch-cpu\libtorch-cpu.nupkgproj" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
</ItemGroup>

<ItemGroup>
<Content Include="..\common\NormalPackage.props" Pack="true" PackagePath="buildTransitive\net6.0\$(MSBuildProjectName).props" />
<Content Include="..\common\NormalPackage.targets" Pack="true" PackagePath="buildTransitive\net6.0\$(MSBuildProjectName).targets" />
<Content Include="..\empty.txt" Pack="true" PackagePath="lib\net6.0\_._" />
<Content Include="..\common\NormalPackage.props" Pack="true" PackagePath="buildTransitive\net8.0\$(MSBuildProjectName).props" />
<Content Include="..\common\NormalPackage.targets" Pack="true" PackagePath="buildTransitive\net8.0\$(MSBuildProjectName).targets" />
<Content Include="..\empty.txt" Pack="true" PackagePath="lib\net8.0\_._" />
<Content Include="..\common\NormalPackage.props" Pack="true" PackagePath="buildTransitive\netstandard2.0\$(MSBuildProjectName).props" />
<Content Include="..\common\NormalPackage.targets" Pack="true" PackagePath="buildTransitive\netstandard2.0\$(MSBuildProjectName).targets" />
<Content Include="..\empty.txt" Pack="true" PackagePath="lib\netstandard2.0\_._" />
Expand Down
12 changes: 6 additions & 6 deletions pkg/TorchSharp-cuda-linux/TorchSharp-cuda-linux.nupkgproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<PackageDescription>TorchSharp makes PyTorch available for .NET users. This package combines the TorchSharp package with LibTorch $(LibTorchVersion) CUDA $(CudaVersionDot) support for Linux.</PackageDescription>
</PropertyGroup>

Expand All @@ -10,13 +10,13 @@
<ProjectReference Include="..\libtorch-cuda-12.1-linux-x64\libtorch-cuda-12.1-linux-x64.nupkgproj" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
</ItemGroup>

<ItemGroup>
<Content Include="..\common\NormalPackage.props" Pack="true" PackagePath="buildTransitive\net6.0\$(MSBuildProjectName).props" />
<Content Include="..\common\NormalPackage.targets" Pack="true" PackagePath="buildTransitive\net6.0\$(MSBuildProjectName).targets" />
<Content Include="..\empty.txt" Pack="true" PackagePath="lib\net6.0\_._" />
<Content Include="..\common\NormalPackage.props" Pack="true" PackagePath="buildTransitive\net8.0\$(MSBuildProjectName).props" />
<Content Include="..\common\NormalPackage.targets" Pack="true" PackagePath="buildTransitive\net8.0\$(MSBuildProjectName).targets" />
<Content Include="..\empty.txt" Pack="true" PackagePath="lib\net8.0\_._" />
<Content Include="$(RepoRoot)\THIRD-PARTY-NOTICES.txt" Pack="true" PackagePath="LICENSE-LIBTORCH.txt" />
<Content Include="$(RepoRoot)\LICENSE.txt" Pack="true" PackagePath="" />
</ItemGroup>
Expand Down
12 changes: 6 additions & 6 deletions pkg/TorchSharp-cuda-windows/TorchSharp-cuda-windows.nupkgproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net8.0;netstandard2.0</TargetFrameworks>
<PackageDescription>TorchSharp makes PyTorch available for .NET users. This package combines the TorchSharp package with LibTorch $(LibTorchVersion) CUDA $(CudaVersionDot) support for Windows.</PackageDescription>
</PropertyGroup>

Expand All @@ -10,13 +10,13 @@
<ProjectReference Include="..\libtorch-cuda-12.1-win-x64\libtorch-cuda-12.1-win-x64.nupkgproj" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
</ItemGroup>

<ItemGroup>
<Content Include="..\common\NormalPackage.props" Pack="true" PackagePath="buildTransitive\net6.0\$(MSBuildProjectName).props" />
<Content Include="..\common\NormalPackage.targets" Pack="true" PackagePath="buildTransitive\net6.0\$(MSBuildProjectName).targets" />
<Content Include="..\empty.txt" Pack="true" PackagePath="lib\net6.0\_._" />
<Content Include="..\common\NormalPackage.props" Pack="true" PackagePath="buildTransitive\net8.0\$(MSBuildProjectName).props" />
<Content Include="..\common\NormalPackage.targets" Pack="true" PackagePath="buildTransitive\net8.0\$(MSBuildProjectName).targets" />
<Content Include="..\empty.txt" Pack="true" PackagePath="lib\net8.0\_._" />
<Content Include="..\common\NormalPackage.props" Pack="true" PackagePath="buildTransitive\netstandard2.0\$(MSBuildProjectName).props" />
<Content Include="..\common\NormalPackage.targets" Pack="true" PackagePath="buildTransitive\netstandard2.0\$(MSBuildProjectName).targets" />
<Content Include="..\empty.txt" Pack="true" PackagePath="lib\netstandard2.0\_._" />
Expand Down
6 changes: 3 additions & 3 deletions pkg/TorchSharp/TorchSharp.nupkgproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Pack">

<PropertyGroup>
<TargetFrameworks>net6.0;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net8.0;netstandard2.0</TargetFrameworks>
<PackageDescription>.NET Bindings for Torch. Requires reference to one of libtorch-cpu, libtorch-cuda-$(CudaVersionDot), libtorch-cuda-$(CudaVersionDot)-win-x64 or libtorch-cuda-$(CudaVersionDot)-linux-x64 version $(LibTorchPackageVersion) to execute.</PackageDescription>
</PropertyGroup>

<ItemGroup>
<Content Include="..\common\NormalPackage.props" Pack="true" PackagePath="buildTransitive\net6.0\$(MSBuildProjectName).props" />
<Content Include="..\common\NormalPackage.targets" Pack="true" PackagePath="buildTransitive\net6.0\$(MSBuildProjectName).targets" />
<Content Include="..\common\NormalPackage.props" Pack="true" PackagePath="buildTransitive\net8.0\$(MSBuildProjectName).props" />
<Content Include="..\common\NormalPackage.targets" Pack="true" PackagePath="buildTransitive\net8.0\$(MSBuildProjectName).targets" />
<Content Include="$(RepoRoot)\LICENSE.txt" Pack="true" PackagePath="" />
<PackageReference Include="Google.Protobuf" Version="3.21.9" />
<PackageReference Include="SharpZipLib" Version="1.4.0" />
Expand Down
8 changes: 4 additions & 4 deletions pkg/TorchVision/TorchVision.nupkgproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Pack">

<PropertyGroup>
<TargetFrameworks>net6.0;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net8.0;netstandard2.0</TargetFrameworks>
<PackageDescription>.NET Bindings for TorchVision. Requires reference to TorchSharp and one of libtorch-cpu, libtorch-cuda-$(CudaVersionDot), libtorch-cuda-$(CudaVersionDot)-win-x64 or libtorch-cuda-$(CudaVersionDot)-linux-x64 version $(LibTorchPackageVersion) to execute.</PackageDescription>
</PropertyGroup>

Expand All @@ -10,9 +10,9 @@
</ItemGroup>

<ItemGroup>
<Content Include="..\common\NormalPackage.props" Pack="true" PackagePath="buildTransitive\net6.0\$(MSBuildProjectName).props" />
<Content Include="..\common\NormalPackage.targets" Pack="true" PackagePath="buildTransitive\net6.0\$(MSBuildProjectName).targets" />
<Content Include="..\empty.txt" Pack="true" PackagePath="lib\net6.0\_._" />
<Content Include="..\common\NormalPackage.props" Pack="true" PackagePath="buildTransitive\net8.0\$(MSBuildProjectName).props" />
<Content Include="..\common\NormalPackage.targets" Pack="true" PackagePath="buildTransitive\net8.0\$(MSBuildProjectName).targets" />
<Content Include="..\empty.txt" Pack="true" PackagePath="lib\net8.0\_._" />
<Content Include="..\common\NormalPackage.props" Pack="true" PackagePath="buildTransitive\netstandard2.0\$(MSBuildProjectName).props" />
<Content Include="..\common\NormalPackage.targets" Pack="true" PackagePath="buildTransitive\netstandard2.0\$(MSBuildProjectName).targets" />
<Content Include="..\empty.txt" Pack="true" PackagePath="lib\netstandard2.0\_._" />
Expand Down
5 changes: 3 additions & 2 deletions src/Examples.Utils/Examples.Utils.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<WarningsNotAsErrors>CS8981</WarningsNotAsErrors>
<!-- The Directory.Build.props initialize TargetFrameworks to multiple targets. We have to clear that out to set only the targets we support. -->
<TargetFrameworks></TargetFrameworks>
<LangVersion>9.0</LangVersion>
<TargetFrameworks Condition="'$(TargetFrameworks)' == ''">net6.0</TargetFrameworks>
<TargetFrameworks Condition="'$(TargetFrameworks)' == ''">net8.0</TargetFrameworks>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand All @@ -17,7 +18,7 @@

<ItemGroup>
<PackageReference Include="SharpZipLib" Version="1.4.0" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.5" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.7" />
</ItemGroup>

<ItemGroup>
Expand Down
3 changes: 2 additions & 1 deletion src/Examples/Examples.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<WarningsNotAsErrors>CS8981</WarningsNotAsErrors>
<OutputType>Exe</OutputType>
<TestUsesLibTorch>true</TestUsesLibTorch>
<TestCuda>true</TestCuda>
<!-- The Directory.Build.props initialize TargetFrameworks to multiple targets. We have to clear that out to set only the targets we support. -->
<TargetFrameworks></TargetFrameworks>
<LangVersion>9.0</LangVersion>
<TargetFrameworks Condition="'$(TargetFrameworks)' == ''">net6.0</TargetFrameworks>
<TargetFrameworks Condition="'$(TargetFrameworks)' == ''">net8.0</TargetFrameworks>
<TestUsesLibTorch>true</TestUsesLibTorch>
<UseMLCodeAnalyzer>false</UseMLCodeAnalyzer>
<UseStyleCopAnalyzer>false</UseStyleCopAnalyzer>
Expand Down
2 changes: 1 addition & 1 deletion src/FSharp.Examples/FSharp.Examples.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<TestUsesLibTorch>true</TestUsesLibTorch>
<TestCuda>true</TestCuda>
<TargetFrameworks></TargetFrameworks>
<TargetFrameworks Condition="'$(TargetFrameworks)' == ''">net6.0</TargetFrameworks>
<TargetFrameworks Condition="'$(TargetFrameworks)' == ''">net8.0</TargetFrameworks>
<TestUsesLibTorch>true</TestUsesLibTorch>
<RootNamespace>Examples</RootNamespace>
<AssemblyName>FSharp.Examples</AssemblyName>
Expand Down
3 changes: 2 additions & 1 deletion src/TorchAudio/TorchAudio.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;netstandard2.0</TargetFrameworks>
<WarningsNotAsErrors>CS8981</WarningsNotAsErrors>
<TargetFrameworks>net8.0;netstandard2.0</TargetFrameworks>
<LangVersion>9.0</LangVersion>
<IncludeInPackage>TorchAudio</IncludeInPackage>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand Down
3 changes: 2 additions & 1 deletion src/TorchSharp/TorchSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />

<PropertyGroup>
<TargetFrameworks>net6.0;netstandard2.0</TargetFrameworks>
<WarningsNotAsErrors>CS8981</WarningsNotAsErrors>
<TargetFrameworks>net8.0;netstandard2.0</TargetFrameworks>
<LangVersion>9.0</LangVersion>
<IncludeInPackage>TorchSharp</IncludeInPackage>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand Down
2 changes: 1 addition & 1 deletion src/TorchSharp/TorchSharp.csproj.DotSettings
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=tensor/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=tensor_005Cenums/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
3 changes: 2 additions & 1 deletion src/TorchVision/TorchVision.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;netstandard2.0</TargetFrameworks>
<WarningsNotAsErrors>CS8981</WarningsNotAsErrors>
<TargetFrameworks>net8.0;netstandard2.0</TargetFrameworks>
<LangVersion>9.0</LangVersion>
<IncludeInPackage>TorchVision</IncludeInPackage>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand Down
2 changes: 1 addition & 1 deletion test/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Import Project="..\Directory.Build.props" />

<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">$(TargetFrameworks);net48</TargetFrameworks>
<IsPackable>false</IsPackable>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<WarningsNotAsErrors>CS8981</WarningsNotAsErrors>
<!-- The Directory.Build.props initialize TargetFrameworks to multiple targets. We have to clear that out to set only the targets we support. -->
<TargetFrameworks></TargetFrameworks>
<TargetFrameworks Condition="'$(SkipNetCoreBuild)' != 'true'">net6.0</TargetFrameworks>
<TargetFrameworks Condition="'$(SkipNetCoreBuild)' != 'true'">net8.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT' And '$(SkipNetFxBuild)' != 'true'">net472;$(TargetFrameworks)</TargetFrameworks>
<TargetFrameworks Condition="'$(TargetFrameworks)' == ''">net6.0</TargetFrameworks>
<TargetFrameworks Condition="'$(TargetFrameworks)' == ''">net8.0</TargetFrameworks>
<TestUsesLibTorch>true</TestUsesLibTorch>
<TestCuda>true</TestCuda>
<IsPackable>false</IsPackable>
Expand Down
5 changes: 3 additions & 2 deletions test/TorchSharpTest/TorchSharpTest.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<WarningsNotAsErrors>CS8981</WarningsNotAsErrors>
<!-- The Directory.Build.props initialize TargetFrameworks to multiple targets.
We have to clear that out to set only the targets we support. -->
<TargetFrameworks></TargetFrameworks>
<TargetFrameworks Condition="'$(SkipNetCoreBuild)' != 'true'">net6.0</TargetFrameworks>
<TargetFrameworks Condition="'$(SkipNetCoreBuild)' != 'true'">net8.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT' And '$(SkipNetFxBuild)' != 'true'">net472;$(TargetFrameworks)</TargetFrameworks>
<TargetFrameworks Condition="'$(TargetFrameworks)' == ''">net6.0</TargetFrameworks>
<TargetFrameworks Condition="'$(TargetFrameworks)' == ''">net8.0</TargetFrameworks>
<TestUsesLibTorch>true</TestUsesLibTorch>
<IsPackable>false</IsPackable>
<UseStyleCopAnalyzer>false</UseStyleCopAnalyzer>
Expand Down