Pregunta

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

¿Fue útil?

Solución

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>

Otros consejos

I fixed this problem by setting the copy-local flag of all referenced TechTalk.SpecFlow dlls to false in my SpecflowPlugin project.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top