Version number: 3.1.80
packages.config<PackageReference> tagsSpecFlow.Tools.MsBuild.Generation NuGet packageSpecFlowSingleFileGenerator custom toolEnable SpecFlowSingleFileGenerator Custom Tool option in Visual Studio extension settings<Major>.<Minor>.<Patch> Follow-up issue to https://github.com/SpecFlowOSS/SpecFlow/issues/1848
Our projects have installed the "Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.8". This includes the analyzer StyleCop.Analyzers with the default rule SA1210 "The using directives within a C# code file are not sorted alphabetically by namespace.".
For our release builds we have the flag TreatWarningsAsErrors = true, so we are not able to compile without errors anymore because of this specflow issue.
By fixing the issue https://github.com/SpecFlowOSS/SpecFlow/issues/1848 the wrong using order was introduced.
MSTest.AssemblyHooks.cs(1,1): error SA1210: Using directives should be ordered alphabetically by the namespaces.
MSTest.AssemblyHooks.cs:
using System.Diagnostics;
using System.CodeDom.Compiler;
using global::Microsoft.VisualStudio.TestTools.UnitTesting;
using global::TechTalk.SpecFlow;
[GeneratedCode("SpecFlow", "3.1.80")]
[TestClass]
public class ...
...
Create a test project (netcoreapp2.1 or net472)
Set
add nuget packages: SpecFlow, SpecFlow.MsTest, SpecFlow.Tools.MsBuild.Generation version 3.1.80
add nuget package: Microsoft.CodeAnalysis.FxCopAnalyzers version 2.9.8
compile
you should see an error like this:
obj\Release\net472\MSTest.AssemblyHooks.cs(1,1): error SA1210: Using directives should be ordered alphabetically by the namespaces.[C:\MyProject\MyProject.csproj]
The files are located here:
https://github.com/SpecFlowOSS/SpecFlow/tree/master/Plugins/TechTalk.SpecFlow.MSTest.Generator.SpecFlowPlugin/build
https://github.com/SpecFlowOSS/SpecFlow/tree/master/Plugins/TechTalk.SpecFlow.NUnit.Generator.SpecFlowPlugin/build
https://github.com/SpecFlowOSS/SpecFlow/tree/master/Plugins/TechTalk.SpecFlow.xUnit.Generator.SpecFlowPlugin/build
If you send us a PR with the correct order, we can release a fixed version probably tomorrow.
If you send us a PR with the correct order, we can release a fixed version probably tomorrow.
PR https://github.com/SpecFlowOSS/SpecFlow/pull/1865 created.
Sorry for the delay. NuGet packages are uploading now to NuGet.org
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
PR https://github.com/SpecFlowOSS/SpecFlow/pull/1865 created.