-
Notifications
You must be signed in to change notification settings - Fork 167
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
Build fails with the update as of Mar 8th commit in main #614
Comments
I was able to mostly root cause the issue. The problem lies in the difference between the .NET SDK in the global.json (5.0103) and the .NET SDK used by the latest Visual Studio (5.0.201). I can build the solution without issue from the command line using Specifically, it appears the analyzer has gotten cleverer at detecting CA1802 around interpolated strings. So to fix this issue, I'll put out a PR to fix the VS warnings, and I'll attempt to pin the analyzer warnings to version 5 of the SDK. However, given that VS may use the latest version of the SDK for intellisense, it may not prevent future tooling breaks. I'll investigate what can be done about the intellisense. I can't imagine we're alone in this. |
Hi @wsugarman , I am not sure if that's going to resolve the issue for good. |
The problem isn't because of your .NET SDK version; it is because the one used by Visual Studio for its static code analyzers in the latest version (presumably starting at v16.9). I am bumping the version of the SDK we use to the latest Visual Studio one, but this behavior seems incorrect. I will follow up with the Visual Studio team to see if it's intended that their analyzers use their own .NET SDK version instead of the one specified in the global.json. Does the issue go away if you try to build from the command line the top-level directory? This should use 5.0.103 and can be confirmed with pushd <dicom-server repository>
dotnet --version
dotnet build Microsoft.Health.Dicom.sln |
I have opened up a separate issue with Visual Studio here. |
Describe the bug
local build of the OSS repo is failing with the following errors -
Severity Code Description Project File Line Suppression State Detail Description
Error CA1802 Field 'DicomServerBlobConfigurationSectionName' is declared as 'readonly' but is initialized with a constant value. Mark this field as 'const' instead. Microsoft.Health.Dicom.Blob {local path|\dicom-server\src\Microsoft.Health.Dicom.Blob\Registration\DicomServerBuilderBlobRegistrationExtensions.cs 23 Active A field is declared static and read-only (Shared and ReadOnly in Visual Basic), and is initialized by using a value that is computable at compile time. Because the value that is assigned to the targeted field is computable at compile time, change the declaration to a const (Const in Visual Basic) field so that the value is computed at compile time instead of at run?time.
Your help will be appreciated. Thank you.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Solution Build resulting in no errors
Actual behavior
See the attached screenshot above.
The text was updated successfully, but these errors were encountered: