question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[macOS] The type initializer for 'Dynamitey.Dynamic' threw an exception

See original GitHub issue

Trying wrap my service using impromptu-interface version 7.0.1-beta40. This my code:

services.AddTransient<SongRepository>();
            services.AddTransient<ISongRepository>(ctx =>
            {
                var repo = ctx.GetRequiredService<SongRepository>();
                var logger = ctx.GetRequiredService<ILogger<SongRepository>>();
                var res = new Wrapper<SongRepository>(repo, logger);

                return res.ActLike<ISongRepository>();
            });

but throw exception on Mac:

Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[0]
      An unhandled exception has occurred: The type initializer for 'Dynamitey.Dynamic' threw an exception.
System.TypeInitializationException: The type initializer for 'Dynamitey.Dynamic' threw an exception. ---> System.IO.FileLoadException: Could not load file or assembly 'System, Version=5.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type, ObjectHandleOnStack keepalive)
   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName)
   at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
   at System.Type.GetType(String typeName, Boolean throwOnError)
   at Dynamitey.Dynamic..cctor()
   --- End of inner exception stack trace ---
   at Dynamitey.Dynamic.GenericDelegateType(Int32 paramCount, Boolean returnVoid)
   at ImpromptuInterface.Build.BuildProxy.GenerateCallSiteFuncType(IEnumerable`1 argTypes, Type returnType, MethodInfo methodInfo, TypeBuilder builder)
   at ImpromptuInterface.Build.BuildProxy.DefineCallsiteField(TypeBuilder builder, String name, Type returnType, Type[] argTypes)
   at ImpromptuInterface.Build.BuildProxy.MakeMethod(ModuleBuilder builder, MethodInfo info, TypeBuilder typeBuilder, Type contextType, Boolean nonRecursive, Boolean defaultImp)
   at ImpromptuInterface.Build.BuildProxy.BuildTypeHelper(ModuleBuilder builder, Type contextType, Type[] interfaces)
   at ImpromptuInterface.Build.BuildProxy.BuildType(Type contextType, Type mainInterface, Type[] otherInterfaces)
   at ImpromptuInterface.Impromptu.ActLike[TInterface](Object originalDynamic, Type[] otherInterfaces)
...

Working fine on Window, didn’t test on Linux.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
sunarycommented, Sep 18, 2017

how can I update Dynamitey?

this is my package: nuget package

0reactions
sunarycommented, Sep 19, 2017

Its worked after upgrade to Dynamitey 2.0.6-beta114. Thanks for your support!

Read more comments on GitHub >

github_iconTop Results From Across the Web

dotnet core in macOS: "The type initializer for 'Crypto' threw ...
I followed the instructions on the .NET Core website, but got this error. Apparently there are some pre-reqs which are missing. Any idea...
Read more >
TypeInitializationException:The type initializer for 'Gdip ...
I'm building an application that runs on both windows and macos. This application converts dng to bmp. On Windows (10) it works but...
Read more >
Untitled
Facebook search bar results order, Biofluid dynamics principles and selected ... Surface type cover filter device driver error 10, Stan lee comic book ......
Read more >
The type initializer for 'zz93.db' threw an exception
I running Unit TEST, using FrameWerk 4.5.1 & ceTe.dynamicPDF.4.0 Version 8.0.4.33803. I try with other version and always is the same Error, ...
Read more >
Untitled
Aw snap error chromebook laptop. Vidock no expresscard slot macbook, Teluguwap video songs downloading software, Triada de hutchinson sifilis pdf file, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found