Skip to content

references mismatch #15

Description

@bblrlo

Hi there, i have installed SpecFlow 2.3.2 and SpecFlow.Assis.Dynamic 1.3.1 and after starting tests I getting exception:

Result StackTrace:
at System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type)
at System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
at System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters, Boolean& isVarArg)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType type, RuntimeType caType, Boolean inherit)
at System.RuntimeType.GetCustomAttributes(Type attributeType, Boolean inherit)
at TechTalk.SpecFlow.Bindings.Discovery.RuntimeBindingRegistryBuilder.BuildBindingsFromType(Type type)
at TechTalk.SpecFlow.Bindings.Discovery.RuntimeBindingRegistryBuilder.BuildBindingsFromAssembly(Assembly assembly)
at TechTalk.SpecFlow.TestRunnerManager.BuildBindingRegistry(IEnumerable1 bindingAssemblies) at TechTalk.SpecFlow.TestRunnerManager.InitializeBindingRegistry(ITestRunner testRunner) at TechTalk.SpecFlow.TestRunnerManager.CreateTestRunner(Int32 threadId) at TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(Int32 threadId) at TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(Assembly testAssembly, Nullable1 managedThreadId)
at Deploy.Web.API.Acceptance.Features.RefDataServersFeatureFeature.FeatureSetup(TestContext testContext)
Result Message: Class Initialization method Deploy.Web.API.Acceptance.Features.RefDataServersFeatureFeature.FeatureSetup threw exception. System.IO.FileLoadException: System.IO.FileLoadException: Could not load file or assembly 'TechTalk.SpecFlow, Version=2.1.0.0, Culture=neutral, PublicKeyToken=0778194805d6db41' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040).
Result StandardOutput: -> Using app.config

If I downgrading SpecFlow to 2.1.0 everything runs fine. But I cannot use specflow lower than 2.3.2
P.S. VisualStudio version is 15.7.1

Activity

  1. marcusoftnet commented on May 24, 2018

    @marcusoftnet
    Owner

    Hello @bblrlo - thanks for the comment and issue.

    I will try to do something about this soon, but right now I don't have a ready DotNet environment to re-compile this on. That is all that is needed, if I understand it correctly; recompile with an updated version of SpecFlow dlls.

    I'll see what I can do soon.
    Thanks a bunch for your patience and for using this little tool.

  2. icnocop commented on Oct 7, 2018

    @icnocop

    @bblrlo , make sure your runtime binding redirect is correct in app.config:

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <configSections>
        <section name="specFlow" type="TechTalk.SpecFlow.Configuration.ConfigurationSectionHandler, TechTalk.SpecFlow" />
      </configSections>
      <specFlow>
        <stepAssemblies>
          <stepAssembly assembly="SpecFlow.Assist.Dynamic" />
        </stepAssemblies>
        <unitTestProvider name="MsTest" />
      </specFlow>
      <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="TechTalk.SpecFlow" publicKeyToken="0778194805d6db41" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-2.3.2.0" newVersion="2.3.2.0" />
          </dependentAssembly>
        </assemblyBinding>
      </runtime>
    </configuration>
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions