Reputation: 1388
I am writing a custom plugin to customise the auto-generated code files SpecFlow produces.
After building the solution and putting it in the 'lib' folder of the SpecFlow testing project. On saving the SpecFlow feature file I get
Specflow plugin : Generation error: Missing [assembly:GeneratorPlugin] attribute in 'path to dll'
Even though I have this marked up in the plugin Assembly
[assembly: GeneratorPluginAttribute(typeof(CustomGeneratorPlugin))]
Using reflection/self-testing I can load the assembly myself and resolve the attribute
Code is here -- https://github.com/chrismckelt/SpecFlowCustomPlugin
Any ideas whats causing this? Thanks
Upvotes: 7
Views: 4252
Reputation: 157
I fixed this problem by setting the copy-local flag of all referenced TechTalk.SpecFlow dlls to false in my SpecflowPlugin project.
Upvotes: 0
Reputation: 1388
Resolved by adding the below 'path' attribute to the generator SpecFlow config section
<generator path=".\lib"
full config
<specFlow>
<generator allowDebugGeneratedFiles="false" allowRowTests="true" generateAsyncTests="false" path=".\lib" />
<runtime stopAtFirstError="false" missingOrPendingStepsOutcome="Ignore" />
<trace traceSuccessfulSteps="true" traceTimings="false" minTracedDuration="0:0:0.1" stepDefinitionSkeletonStyle="RegexAttribute" />
<plugins>
<add name="McKeltCustom" path=".\lib" type="GeneratorAndRuntime" />
</plugins>
<stepAssemblies>
<stepAssembly assembly="SpecFlow.Assist.Dynamic" />
</stepAssemblies>
</specFlow>
Upvotes: 3