-
Notifications
You must be signed in to change notification settings - Fork 157
NUnit1008
Mikkel Nylander Bundgaard edited this page Apr 25, 2020
·
2 revisions
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.
#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.
[System.Diagnostics.CodeAnalysis.SuppressMessage("Structure",
"NUnit1008:Specifying ParallelScope.Self on assembly level has no effect.",
Justification = "Reason...")]
Copyright (c) 2018 The NUnit Project - Licensed under CC BY-NC-SA 4.0