docs/articles/nunit-analyzers/NUnit1008.md
| Topic | Value |
|---|---|
| Id | NUnit1008 |
| Severity | Warning |
| Enabled | True |
| Category | Structure |
| Code | ParallelizableUsageAnalyzer |
Specifying ParallelScope.Self on assembly level has no effect.
Bring developers' attention to a scenario in which they may believe they are parallelizing something when in fact they are not and their efforts will have no effect.
In AssemblyInfo.cs:
[assembly: Parallelizable(ParallelScope.Self)]
ParallelScope.Self only applies to classes and methods,
not to assemblies.
Either remove it or change to a valid option, such as:
[assembly: Parallelizable(ParallelScope.Children)]
Or:
[assembly: Parallelizable(ParallelScope.Fixtures)]
Configure the severity per project, for more info see MSDN.
# NUnit1008: Specifying ParallelScope.Self on assembly level has no effect
dotnet_diagnostic.NUnit1008.severity = chosenSeverity
where chosenSeverity can be one of none, silent, suggestion, warning, or error.
#pragma warning disable NUnit1008 // Specifying ParallelScope.Self on assembly level has no effect
Code violating the rule here
#pragma warning restore NUnit1008 // Specifying ParallelScope.Self on assembly level has no effect
Or put this at the top of the file to disable all instances.
#pragma warning disable NUnit1008 // Specifying ParallelScope.Self on assembly level has no effect
[SuppressMessage][System.Diagnostics.CodeAnalysis.SuppressMessage("Structure",
"NUnit1008:Specifying ParallelScope.Self on assembly level has no effect",
Justification = "Reason...")]