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

Suave.Testing issues with dotnet core #639

Closed
Banashek opened this issue Aug 12, 2017 · 5 comments
Closed

Suave.Testing issues with dotnet core #639

Banashek opened this issue Aug 12, 2017 · 5 comments

Comments

@Banashek
Copy link

Have an existing dotnet core project with the following dependencies:
Expecto: 5.0.0

I went to add the following to do some api testing:
Suave: 2.1.1
Suave.Testing: 2.1.1

When running the application, I get the following error:

Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'Expecto, Version=4.0.3.0, Culture=neutral, PublicKeyToken=null'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Familiar with dependency hell and knowing that I can just use the older api, I switch my Expecto dependency to:
Expecto: 4.0.3

Existing tests run fine.

If I add a simple api test (like the one found in the readme), I get the following error:

Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for '<StartupCode$CallerId-Tests>.$ApiTests' threw an exception. ---> System.IO.FileLoadException: Could not load file or assembly 'Suave, Version=2.1.1.0, Culture=neutral, PublicKeyToken=null'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
   --- End of inner exception stack trace ---
   at ApiTests.get_tests()
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at Expecto.Impl.getTestFromMemberInfo@1102-1.Invoke(a focusedState)
   at Microsoft.FSharp.Core.OptionModule.Map[T,TResult](FSharpFunc`2 mapping, FSharpOption`1 option)
   at Expecto.Impl.testFromMember(MemberInfo mi)
   at Microsoft.FSharp.Collections.Internal.IEnumerator.choose@165.System-Collections-IEnumerator-MoveNext()
   at Microsoft.FSharp.Collections.SeqModule.ToList[T](IEnumerable`1 source)
   at Expecto.Impl.testFromType@1131.Invoke(Type t)
   at Microsoft.FSharp.Collections.Internal.IEnumerator.choose@165.System-Collections-IEnumerator-MoveNext()
   at Microsoft.FSharp.Collections.SeqModule.ToList[T](IEnumerable`1 source)
   at Expecto.Impl.testFromAssemblyWithFilter(FSharpFunc`2 typeFilter, Assembly a)
   at Expecto.Tests.runTestsInAssembly(ExpectoConfig config, String[] args)

Any suggestions?

@haf
Copy link
Contributor

haf commented Aug 16, 2017

Should have been fixed with #640 – will compile & release fixes and then we can test here.

@haf haf added the bug-major label Aug 16, 2017
@Banashek
Copy link
Author

Yeah after doing some other core stuff I've seen these type initializer does not exist kind of errors all over the place

@haf
Copy link
Contributor

haf commented Aug 17, 2017

Could you please check now that I've released?

@Banashek
Copy link
Author

Looks good.

Thanks for getting to that so quickly!

@haf
Copy link
Contributor

haf commented Aug 17, 2017

You're welcome. :)

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

2 participants