-
Notifications
You must be signed in to change notification settings - Fork 282
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
Update to .NET 9 #2674
base: main
Are you sure you want to change the base?
Update to .NET 9 #2674
Conversation
- name: Database | ||
value: Northwind | ||
- name: platform | ||
value: AnyCPU | ||
- name: TargetNetFxVersion | ||
value: net481 | ||
- name: TargetNetCoreVersion | ||
value: net8.0 | ||
value: net9.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what the exact purpose of this value is
@@ -152,7 +152,11 @@ internal sealed class BinaryOrderedUdtNormalizer : Normalizer | |||
if (nullByte == 0) | |||
{ | |||
result = _nullInstance; | |||
s.Read(_padBuffer, 0, _padBuffer.Length); | |||
#if NET8_0_OR_GREATER |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes the new CA2022
@@ -12,6 +12,7 @@ | |||
<Configurations>Debug;Release;</Configurations> | |||
<Platforms>AnyCPU;x86;x64</Platforms> | |||
<ReferenceType Condition="'$(ReferenceType)'==''">Project</ReferenceType> | |||
<NuGetAudit>false</NuGetAudit> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To prevent NuGet audit on test projects giving warnings as errors on old packages
FYI, the pipeline is expected to fail because lack of |
@DavoudEshtehari Yes, that was expected, but it did not even fail ?? |
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
@JRahnama Thanks, much better error this time 😄
|
@cheenamalhotra @DavoudEshtehari @JRahnama @David-Engel What do we need to do to move this along? |
1ES images do not have Net9.0 added. You can see included SDK in 1ES at here. What we can do is trying to install them manually, but then comes VS issues. Net9.0 needs another version of VS |
To streamline the process and follow the pattern, a new artifact should be included in the images to reduce installation time for each run. But the compatible VS would be required though. |
Not sure I understand the concerns about VS. I you just install the 9.0 preview SDK via a builtin Azure DevOps task and use dotnet build - but as usual I am probably overlooking something |
This is because .NET 9.0 is typically still in development or early release stages, and the corresponding tooling support for the latest .NET version is often provided in the preview releases of Visual Studio. For testing you can remove VS preview from your local machine and try running your application in Net9 |
@JRahnama I just use this setting in VS Options: |
but if you look into VS Installer you probably will see something similar as below. |
@ErikEJ , hope you don't mind me pushing the yaml changes into your PR. |
@JRahnama no, not at all! I would love to see this build |
I think this will need a change in ci-prebuild-step.yml like:
|
When tested on a local machine having .Net9.0 preview, Code SYSLIB0057 was thrown by the compiler for the following files:
|
Basically you need to change the code to something similar to below: #if !NET9_0_OR_GREATER
validationCertificate = new X509Certificate(validationCertFileName);
#else
validationCertificate = X509CertificateLoader.LoadCertificateFromFile(validationCertFileName);
#endif in VirtualSecureModeEnclaveProviderBase.cs: #if !NET9_0_OR_GREATER
certificateCollection.Import(data);
#else
_ = X509CertificateLoader.LoadCertificate(data);
#endif and in VirtualSecureModeEnclaveProvider.cs: #if !NET9_0_OR_GREATER
Certificate = new X509Certificate2(payload);
#else
_ = X509CertificateLoader.LoadCertificate(payload);
#endif After that you will get 5 more errors such as below:
Now we have to address those. |
For the new CA2022 error, in addition to #if NET8_0_OR_GREATER for ReadExactly, since the compiler is throwing error for TargetFramework=net6.0, a #pragma warning disable/restore CA2022 was added for the #else block. |
@ErikEJ, can I push minor fixes into this branch for issues found when compiling MDS locally? |
Preferably, add them to the .editorconfig file inside netcore folder. Per documentation
Please make sure these do not apply to these cases. |
@arellegue go ahead... |
A "dotnet_diagnostic.CA2022.severity = error" was added to .editorconfig instead since it is the preferred method. |
fixes #2669