From e975a987f1b850c1f3f2dc4565318eba9ecce87e Mon Sep 17 00:00:00 2001 From: Mark Seemann Date: Mon, 16 Oct 2023 20:30:36 +0200 Subject: [PATCH 1/2] Upgrade C# code to .NET 6 The upgrade was performed by `upgrade-assistant upgrade`. --- csharp/Properties/AssemblyInfo.cs | 23 ---- csharp/csharp.csproj | 167 +++++------------------------- csharp/csharp.sln | 4 +- csharp/packages.config | 25 ----- 4 files changed, 26 insertions(+), 193 deletions(-) delete mode 100644 csharp/packages.config diff --git a/csharp/Properties/AssemblyInfo.cs b/csharp/Properties/AssemblyInfo.cs index dc5db47d..a6501f9b 100644 --- a/csharp/Properties/AssemblyInfo.cs +++ b/csharp/Properties/AssemblyInfo.cs @@ -1,16 +1,6 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("csharp")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("csharp")] -[assembly: AssemblyCopyright("Copyright © 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -21,16 +11,3 @@ using System.Runtime.InteropServices; // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("176c0214-9136-4079-8dab-11d7420c3881")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/csharp/csharp.csproj b/csharp/csharp.csproj index db182545..c14047dc 100644 --- a/csharp/csharp.csproj +++ b/csharp/csharp.csproj @@ -1,150 +1,31 @@ - - - - - - + - Debug - AnyCPU - {176C0214-9136-4079-8DAB-11D7420C3881} + net6.0 Exe - Properties - csharp - csharp - v4.8.1 - 512 - true - - - + false + csharp + csharp + Copyright © 2017 + 1.0.0.0 + 1.0.0.0 - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - packages\ApprovalTests.5.9.0\lib\net462\ApprovalTests.dll - - - packages\ApprovalUtilities.5.9.0\lib\net462\ApprovalUtilities.dll - - - packages\DiffEngine.12.2.1\lib\net48\DiffEngine.dll - - - packages\EmptyFiles.4.5.0\lib\net461\EmptyFiles.dll - - - packages\Microsoft.Bcl.AsyncInterfaces.7.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll - - - packages\Microsoft.Extensions.DependencyInjection.Abstractions.7.0.0\lib\net462\Microsoft.Extensions.DependencyInjection.Abstractions.dll - - - packages\Microsoft.Win32.Registry.5.0.0\lib\net461\Microsoft.Win32.Registry.dll - - - packages\NUnit.3.13.3\lib\net45\nunit.framework.dll - - - - packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll - - - packages\System.CodeDom.6.0.0\lib\net461\System.CodeDom.dll - - - - packages\System.Data.SqlClient.4.8.5\lib\net461\System.Data.SqlClient.dll - - - - packages\System.Memory.4.5.5\lib\net461\System.Memory.dll - - - - packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll - - - packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\net461\System.Runtime.CompilerServices.Unsafe.dll - - - packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll - True - True - - - packages\System.Security.AccessControl.6.0.0\lib\net461\System.Security.AccessControl.dll - - - packages\System.Security.Principal.Windows.5.0.0\lib\net461\System.Security.Principal.Windows.dll - - - packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll - - - packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll - - - - - - - - - packages\TextCopy.6.2.1\lib\net462\TextCopy.dll - - - - - - - - - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - - - - - - + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/csharp/csharp.sln b/csharp/csharp.sln index 62ff78a8..b45669e3 100644 --- a/csharp/csharp.sln +++ b/csharp/csharp.sln @@ -1,9 +1,9 @@ - + Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "csharp", "csharp.csproj", "{176C0214-9136-4079-8DAB-11D7420C3881}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "csharp", "csharp.csproj", "{176C0214-9136-4079-8DAB-11D7420C3881}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/csharp/packages.config b/csharp/packages.config deleted file mode 100644 index 52a78b1b..00000000 --- a/csharp/packages.config +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From 6fc15844b7b916ccd71af8d8a7e21f2a8d8a9d01 Mon Sep 17 00:00:00 2001 From: Mark Seemann Date: Mon, 16 Oct 2023 20:49:28 +0200 Subject: [PATCH 2/2] Add Microsoft.NET.Test.Sdk NuGet package This enables running unit tests on .NET (Core). The `false` line comes from this article by Andrew Lock: https://andrewlock.net/fixing-the-error-program-has-more-than-one-entry-point-defined-for-console-apps-containing-xunit-tests/ --- csharp/csharp.csproj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/csharp/csharp.csproj b/csharp/csharp.csproj index c14047dc..85b6f03d 100644 --- a/csharp/csharp.csproj +++ b/csharp/csharp.csproj @@ -3,6 +3,7 @@ net6.0 Exe false + false csharp csharp Copyright © 2017 @@ -18,6 +19,7 @@ +