Skip to content

Commit a73cdb5

Browse files
authored
Update to .NET 10 SDK (#1975)
This change does the following: - Build with .NET 10 SDK - Update test SDK to 10 - Add target for .NET 10 - Use latest langversion - Convert to use slnx format
1 parent a6297a5 commit a73cdb5

File tree

11 files changed

+101
-229
lines changed

11 files changed

+101
-229
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373

7474
env:
7575
RunPeVerify: true
76-
Solution_Name: Open-XML-SDK.sln
76+
Solution_Name: Open-XML-SDK.slnx
7777
Configuration: ${{ matrix.configuration }}
7878
ProjectLoadStyle: ${{ matrix.projectloadstyle }}
7979

@@ -88,7 +88,9 @@ jobs:
8888
- name: Install .NET Core
8989
uses: actions/setup-dotnet@v5
9090
with:
91-
dotnet-version: 6.0.x
91+
dotnet-version: |
92+
6.0.x
93+
8.0.x
9294
- name: Install global.json .NET
9395
uses: actions/setup-dotnet@v5
9496
- name: Restore

Directory.Build.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@
6262
</When>
6363
<Otherwise>
6464
<PropertyGroup>
65-
<ProductTargetFrameworks>netstandard2.0;net8.0;net35;net40;net46</ProductTargetFrameworks>
66-
<FrameworkTargetFrameworks>netstandard2.0;net6.0;net8.0;net35;net40;net46</FrameworkTargetFrameworks>
65+
<ProductTargetFrameworks>netstandard2.0;net10.0;net8.0;net35;net40;net46</ProductTargetFrameworks>
66+
<FrameworkTargetFrameworks>netstandard2.0;net10.0;net6.0;net8.0;net35;net40;net46</FrameworkTargetFrameworks>
6767
<AssetsTargetFrameworks>netstandard2.0;net472</AssetsTargetFrameworks>
6868
<TestTargetFrameworks>net8.0</TestTargetFrameworks>
6969
<TestTargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">$(TestTargetFrameworks);net472</TestTargetFrameworks>
@@ -87,7 +87,7 @@
8787
</PropertyGroup>
8888

8989
<PropertyGroup>
90-
<LangVersion>13</LangVersion>
90+
<LangVersion>latest</LangVersion>
9191
</PropertyGroup>
9292

9393
<PropertyGroup>

Directory.Packages.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0" />
1212
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.SourceGenerators.Testing" Version="1.1.2" />
1313
<PackageVersion Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="3.11.0-beta1.24219.2" />
14-
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
14+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
1515
<PackageVersion Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" />
1616
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
17-
<PackageVersion Include="Microsoft.Testing.Extensions.CodeCoverage" Version="17.14.2" />
17+
<PackageVersion Include="Microsoft.Testing.Extensions.CodeCoverage" Version="18.1.0" />
1818
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
1919
<PackageVersion Include="NSubstitute" Version="5.3.0" />
2020
<PackageVersion Include="NuGet.Common" Version="6.13.2" />
@@ -32,6 +32,6 @@
3232
<PackageVersion Include="System.Text.Json" Version="9.0.0" />
3333
<PackageVersion Include="System.Xml.ReaderWriter" Version="4.3.1" />
3434
<PackageVersion Include="System.ValueTuple" Version="4.6.1" />
35-
<PackageVersion Include="xunit.v3" Version="1.0.0" />
35+
<PackageVersion Include="xunit.v3.mtp-v2" Version="3.2.1" />
3636
</ItemGroup>
3737
</Project>

Open-XML-SDK.sln

Lines changed: 0 additions & 216 deletions
This file was deleted.

Open-XML-SDK.slnx

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<Solution>
2+
<Folder Name="/gen/">
3+
<Project Path="gen/DocumentFormat.OpenXml.Generator.Models/DocumentFormat.OpenXml.Generator.Models.csproj" />
4+
<Project Path="gen/DocumentFormat.OpenXml.Generator/DocumentFormat.OpenXml.Generator.csproj" />
5+
</Folder>
6+
<Folder Name="/samples/">
7+
<File Path="samples/Directory.Build.props" />
8+
<File Path="samples/Directory.Build.targets" />
9+
<Project Path="samples/DocumentTaskExample/DocumentTaskSample.csproj" />
10+
<Project Path="samples/IsolatedStorageExceptionWorkaround/IsolatedStorageExceptionWorkaround.csproj" />
11+
<Project Path="samples/Linq/SvgExample/SvgExampleLinq.csproj" />
12+
<Project Path="samples/NamedSheetView/AddNamedSheetView.csproj" />
13+
<Project Path="samples/RichData/RichData.csproj" />
14+
<Project Path="samples/SunburstChartExample/SunburstChartExample.csproj" />
15+
<Project Path="samples/SVGExample/SVGExample.csproj" />
16+
<Project Path="samples/ThreadedCommentExample/ThreadedCommentExample.csproj" />
17+
</Folder>
18+
<Folder Name="/samples/Linq/">
19+
<Project Path="samples/AnimatedModel3DExample/AddAnimatedModel3D.csproj" />
20+
</Folder>
21+
<Folder Name="/Solution Items/">
22+
<File Path=".editorconfig" />
23+
<File Path=".vsconfig" />
24+
<File Path="CHANGELOG.md" />
25+
<File Path="data/OpenXmlData.targets" />
26+
<File Path="Directory.Build.props" />
27+
<File Path="Directory.Build.targets" />
28+
<File Path="Directory.Packages.props" />
29+
<File Path="GitVersion.yml" />
30+
<File Path="global.json" />
31+
<File Path="LICENSE" />
32+
<File Path="NuGet.Config" />
33+
<File Path="README.md" />
34+
<File Path="stylecop.json" />
35+
</Folder>
36+
<Folder Name="/src/">
37+
<File Path="src/common/FrameworkShims.targets" />
38+
<File Path="src/Directory.Build.props" />
39+
<File Path="src/Directory.Build.targets" />
40+
<Project Path="src/DocumentFormat.OpenXml.Features/DocumentFormat.OpenXml.Features.csproj" />
41+
<Project Path="src/DocumentFormat.OpenXml.Framework/DocumentFormat.OpenXml.Framework.csproj" />
42+
<Project Path="src/DocumentFormat.OpenXml.Linq/DocumentFormat.OpenXml.Linq.csproj" />
43+
<Project Path="src/DocumentFormat.OpenXml/DocumentFormat.OpenXml.csproj" />
44+
</Folder>
45+
<Folder Name="/test/">
46+
<File Path="test/Directory.Build.props" />
47+
<File Path="test/Directory.Build.targets" />
48+
<Project Path="test/DocumentFormat.OpenXml.Benchmarks/DocumentFormat.OpenXml.Benchmarks.csproj" />
49+
<Project Path="test/DocumentFormat.OpenXml.Framework.Features.Tests/DocumentFormat.OpenXml.Framework.Features.Tests.csproj" />
50+
<Project Path="test/DocumentFormat.OpenXml.Framework.Tests/DocumentFormat.OpenXml.Framework.Tests.csproj" />
51+
<Project Path="test/DocumentFormat.OpenXml.Linq.Tests/DocumentFormat.OpenXml.Linq.Tests.csproj" />
52+
<Project Path="test/DocumentFormat.OpenXml.Packaging.Tests/DocumentFormat.OpenXml.Packaging.Tests.csproj" />
53+
<Project Path="test/DocumentFormat.OpenXml.Tests.Assets/DocumentFormat.OpenXml.Tests.Assets.csproj" />
54+
<Project Path="test/DocumentFormat.OpenXml.Tests/DocumentFormat.OpenXml.Tests.csproj" />
55+
</Folder>
56+
</Solution>

global.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
22
"sdk": {
3-
"version": "9.0.100",
3+
"version": "10.0.100",
44
"rollForward": "feature"
5+
},
6+
"test": {
7+
"runner": "Microsoft.Testing.Platform"
58
}
69
}

src/Directory.Build.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<PropertyGroup>
55
<EnablePackageValidation>true</EnablePackageValidation>
6-
<PackageValidationBaselineVersion>3.1.1</PackageValidationBaselineVersion>
6+
<PackageValidationBaselineVersion>3.3.0</PackageValidationBaselineVersion>
77
</PropertyGroup>
88

99
<ItemGroup Condition="$(IsFramework)">

src/DocumentFormat.OpenXml.Framework/DocumentFormat.OpenXml.Framework.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<RootNamespace>DocumentFormat.OpenXml</RootNamespace>
2929
</PropertyGroup>
3030

31-
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == 'net6.0' OR '$(TargetFramework)' == 'net7.0' OR '$(TargetFramework)' == 'net8.0' ">
31+
<ItemGroup Condition="!$(IsFramework)">
3232
<PackageReference Include="System.IO.Packaging" />
3333
</ItemGroup>
3434

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#nullable enable
2+
DocumentFormat.OpenXml.Validation.OpenXmlValidator.Validate(DocumentFormat.OpenXml.OpenXmlElement! openXmlElement, System.Threading.CancellationToken token = default(System.Threading.CancellationToken)) -> System.Collections.Generic.IEnumerable<DocumentFormat.OpenXml.Validation.ValidationErrorInfo!>!
3+
DocumentFormat.OpenXml.Validation.OpenXmlValidator.Validate(DocumentFormat.OpenXml.Packaging.OpenXmlPackage! openXmlPackage, System.Threading.CancellationToken token = default(System.Threading.CancellationToken)) -> System.Collections.Generic.IEnumerable<DocumentFormat.OpenXml.Validation.ValidationErrorInfo!>!
4+
DocumentFormat.OpenXml.Validation.OpenXmlValidator.Validate(DocumentFormat.OpenXml.Packaging.OpenXmlPart! openXmlPart, System.Threading.CancellationToken token = default(System.Threading.CancellationToken)) -> System.Collections.Generic.IEnumerable<DocumentFormat.OpenXml.Validation.ValidationErrorInfo!>!
5+
6+
DocumentFormat.OpenXml.HexBinaryValue.TryWriteBytes(System.Span<byte> bytes) -> bool
7+
static DocumentFormat.OpenXml.HexBinaryValue.Create(System.ReadOnlySpan<byte> bytes) -> DocumentFormat.OpenXml.HexBinaryValue!
8+
9+
virtual DocumentFormat.OpenXml.OpenXmlWriter.WriteElementAsync(DocumentFormat.OpenXml.OpenXmlElement! elementObject) -> System.Threading.Tasks.Task!
10+
virtual DocumentFormat.OpenXml.OpenXmlWriter.WriteEndElementAsync() -> System.Threading.Tasks.Task!
11+
virtual DocumentFormat.OpenXml.OpenXmlWriter.WriteStartDocumentAsync(bool standalone) -> System.Threading.Tasks.Task!
12+
virtual DocumentFormat.OpenXml.OpenXmlWriter.WriteStartElementAsync(DocumentFormat.OpenXml.OpenXmlElement! elementObject, System.Collections.Generic.IEnumerable<DocumentFormat.OpenXml.OpenXmlAttribute>! attributes, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string!, string!>>! namespaceDeclarations) -> System.Threading.Tasks.Task!
13+
virtual DocumentFormat.OpenXml.OpenXmlWriter.WriteStartElementAsync(DocumentFormat.OpenXml.OpenXmlElement! elementObject, System.Collections.Generic.IEnumerable<DocumentFormat.OpenXml.OpenXmlAttribute>! attributes) -> System.Threading.Tasks.Task!
14+
virtual DocumentFormat.OpenXml.OpenXmlWriter.WriteStartElementAsync(DocumentFormat.OpenXml.OpenXmlElement! elementObject) -> System.Threading.Tasks.Task!
15+
virtual DocumentFormat.OpenXml.OpenXmlWriter.WriteStringAsync(string! text) -> System.Threading.Tasks.Task!
16+
virtual DocumentFormat.OpenXml.OpenXmlWriter.WriteStartDocumentAsync() -> System.Threading.Tasks.Task!
17+
override DocumentFormat.OpenXml.OpenXmlPartWriter.WriteElementAsync(DocumentFormat.OpenXml.OpenXmlElement! elementObject) -> System.Threading.Tasks.Task!
18+
override DocumentFormat.OpenXml.OpenXmlPartWriter.WriteEndElementAsync() -> System.Threading.Tasks.Task!
19+
override DocumentFormat.OpenXml.OpenXmlPartWriter.WriteStartDocumentAsync() -> System.Threading.Tasks.Task!
20+
override DocumentFormat.OpenXml.OpenXmlPartWriter.WriteStartDocumentAsync(bool standalone) -> System.Threading.Tasks.Task!
21+
override DocumentFormat.OpenXml.OpenXmlPartWriter.WriteStartElementAsync(DocumentFormat.OpenXml.OpenXmlElement! elementObject, System.Collections.Generic.IEnumerable<DocumentFormat.OpenXml.OpenXmlAttribute>! attributes, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string!, string!>>! namespaceDeclarations) -> System.Threading.Tasks.Task!
22+
override DocumentFormat.OpenXml.OpenXmlPartWriter.WriteStartElementAsync(DocumentFormat.OpenXml.OpenXmlElement! elementObject, System.Collections.Generic.IEnumerable<DocumentFormat.OpenXml.OpenXmlAttribute>! attributes) -> System.Threading.Tasks.Task!
23+
override DocumentFormat.OpenXml.OpenXmlPartWriter.WriteStartElementAsync(DocumentFormat.OpenXml.OpenXmlElement! elementObject) -> System.Threading.Tasks.Task!
24+
override DocumentFormat.OpenXml.OpenXmlPartWriter.WriteStringAsync(string! text) -> System.Threading.Tasks.Task!
25+
DocumentFormat.OpenXml.OpenXmlPartWriterSettings.Async.get -> bool
26+
DocumentFormat.OpenXml.OpenXmlPartWriterSettings.Async.set -> void
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#nullable enable
2+

0 commit comments

Comments
 (0)