Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

references mismatch #15

Open
bblrlo opened this issue May 22, 2018 · 2 comments
Open

references mismatch #15

bblrlo opened this issue May 22, 2018 · 2 comments

Comments

@bblrlo
Copy link

bblrlo commented May 22, 2018

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

@marcusoftnet
Copy link
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.

@icnocop
Copy link

icnocop commented Oct 7, 2018

@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
Projects
None yet
Development

No branches or pull requests

3 participants