我正在编写一个自定义插件来自定义SpecFlow生成的自动生成的代码文件。
构建解决方案并将其放入SpecFlow测试项目的“lib”文件夹之后。 保存我得到的SpecFlow功能文件
Specflow plugin : Generation error: Missing [assembly:GeneratorPlugin] attribute in 'path to dll'即使我在插件程序集中标记了这一点
[assembly: GeneratorPluginAttribute(typeof(CustomGeneratorPlugin))]使用反射/自我测试我可以自己加载程序集并解析属性
代码在这里 - https://github.com/chrismckelt/SpecFlowCustomPlugin
有什么想法导致这个? 谢谢
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
最满意答案
通过将以下'path'属性添加到生成器SpecFlow配置部分来解决
<generator path=".\lib"完整配置
<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>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>更多推荐
SpecFlow,assembly,plugin,测试,电脑培训,计算机培训,IT培训"/> <meta name="d
发布评论