Comments (12)
I ended up just reviewing all the errors in VS and using its UI to configure them to suggestions. Thankfully those worked reliably this time! Thanks @sharwell for your help and thanks for all your hard work on dotnet!
from roslyn.
Parking on Sam until we tweak the assembly load to match.
from roslyn.
Can you use Visual Studio's Report a Problem tool to file a report on this with additional information? The specific information we need is a copy of the msbuild.binlog file produced when you build your project from the command line with the -bl
flag.
from roslyn.
Can you use Visual Studio's Report a Problem tool to file a report on this with additional information? The specific information we need is a copy of the msbuild.binlog file produced when you build your project from the command line with the
-bl
flag.
I can probably provide that if it will give me the chance to redact portions of it. Are there specific pieces of that file you're looking for? I imagine there will be plenty of type names included that I need to redact.
from roslyn.
I'd be looking at the inputs to the $task Csc
to determine the complete set of AnalyzerConfigFiles passed to the compiler, along with any command line arguments related to the diagnostic you're seeing here. One of them is setting the severity to warning or error. It shouldn't be difficult to locate the source of the severity setting using the MSBuild Log Viewer.
from roslyn.
So using MSBuild Log Viewer I was able to find a project that had one error. Figured that would be a simple case to work through. It also happens to be the first error in the build for what that's worth.
...\HttpLib\BasicHttpProvider.cs(9,66): error IDE0090: 'new' expression can be simplified
And in the command line args for compiling that dll I found only these three analyzerconfig arguments:
/analyzerconfig:C:\git\sln\.editorconfig
/analyzerconfig:obj\Debug\netstandard2.0\HttpLib.GeneratedMSBuildEditorConfig.editorconfig
/analyzerconfig:C:\Users\nicolg\.nuget\packages\microsoft.codeanalysis.netanalyzers\8.0.0\buildTransitive\config\analysislevel_8_recommended.globalconfig
None which mention IDE0090.
Have I misunderstood how to interpret the log? Are there other places where severity can be set? I admit I don't know all the arguments for csc, but I didn't see anything obvious. Certainly no IDE0090 explicitely.
from roslyn.
Do any of those files list csharp_style_implicit_object_creation_when_type_is_apparent
?
from roslyn.
yes, my main .editorconfig has this:
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
hmm, did the legacy true:suggestion
severity formatting finally get pulled and now causing a fuss?
from roslyn.
I guess the old formatting isn't a problem but not having the new format is. Adding the IDE0090 rule correctly sets the severity and gets rid of the error. Is there a tool that can go through all those and duplicate them? I have quite a few set using the old format.
from roslyn.
hmm, did the legacy true:suggestion severity formatting finally get pulled and now causing a fuss?
The true:suggestion
syntax will start to take effect for .NET 9 SDK with AnalysisLevel
set to 9 or greater. It may also work that way in 8.0.300 if you manually set AnalysisLevel
to 9 or greater.
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
This would not be sufficient to trigger an error. The default severity for IDE0090 is suggestion, and TreatWarningsAsErrors only applies to warnings and errors. If an error is reported in the build, something has reconfigured IDE0090 from its default severity of suggestion to either error, or to warning with TreatWarningsAsErrors enabled.
from roslyn.
I have this setup:
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<AnalysisMode>All</AnalysisMode>
<AnalysisLevel>latest-recommended</AnalysisLevel>
And I even commented all those out and I still got errors instead of suggestions (This was before I set the rules).
Would 8.0.300 target 9 with latest-recommended? I wouldn't have expected that myself.
from roslyn.
And I even commented all those out and I still got errors instead of suggestions (This was before I set the rules).
I'm not sure I'll be able to resolve this without a concrete repro (either a sample solution or build log submitted through the feedback system and not posted publicly).
Would 8.0.300 target 9 with latest-recommended?
No, 8.0.300 defines _LatestAnalysisLevel
as 8.0.
from roslyn.
Related Issues (20)
- Typing a quote character after `new` inserts two quotes. HOT 2
- .NET 9 `Preview.5`, `Preview.6`, `Preview.7` C# compiler crashes on LINQ expression with string interpolation HOT 7
- [Source Generators] ISyntaxReceiver instances should be able to access AdditionalFiles HOT 1
- Changing warning CS8002 to an error still results in binary being outputted despite error HOT 1
- [Automated] PRs inserted in VS build feature.debugger.main-35026.134
- [Automated] PRs inserted in VS build feature.dotnetVS-35026.97
- Suggestion to Include Criteria for Identifying Generated Code in AnalysisContext.ConfigureGeneratedCodeAnalysis() Documentation
- Precompile compile-time declared Lambda Expression. HOT 2
- Code Analysis rule CA1860 gives a biased message
- CodeGen for defaulted collection expression elements (Span via InlineArray) HOT 5
- CS7038: Failed to emit module if new collection syntax is used with an implicit ImmutableArray operator.
- IEventSymbol.DeclaringSyntaxReferences Syntax is VariableDeclaratorSyntax not EventDeclarationSyntax HOT 2
- Create LangVersion 13 HOT 5
- [Automated] PRs inserted in VS build feature.debugger.main-35027.161
- [Automated] PRs inserted in VS build main-35027.32
- Roslyn wrote incorrect timedatestime to PE Coff Header of a .Net 8.0 program file HOT 2
- IDE0304 should preserve the leading comment HOT 5
- Support limiting CS1591 to certain members
- [Automated] PRs inserted in VS build main-35028.101
- IDE0161 - Convert to file-scoped namespace reported on files with global namespace type declarations
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from roslyn.