[macOS] The type initializer for 'Dynamitey.Dynamic' threw an exception
See original GitHub issueTrying 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:
- Created 6 years ago
- Comments:6 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
how can I update Dynamitey?
this is my package:
Its worked after upgrade to Dynamitey 2.0.6-beta114. Thanks for your support!