ReflectionTypeLoadException thrown when initializing AutoMapper
See original GitHub issueDescription
Here is the callstack:
____ _ _ ____ _ __ __
/ ___(_) |_| _ \ ___| | ___ __ _ ___ ___| \/ | __ _ _ __ __ _ __ _ ___ _ __
| | _| | __| |_) / _ \ |/ _ \/ _` / __|/ _ \ |\/| |/ _` | '_ \ / _` |/ _` |/ _ \ '__|
| |_| | | |_| _ < __/ | __/ (_| \__ \ __/ | | | (_| | | | | (_| | (_| | __/ |
\____|_|\__|_| \_\___|_|\___|\__,_|___/\___|_| |_|\__,_|_| |_|\__,_|\__, |\___|_|
|___/
0.12.0
[FTL] Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.RuntimeAssembly.get_DefinedTypes()
at System.Linq.Enumerable.<SelectManyIterator>d__17`2.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at AutoMapper.Configuration.MapperConfigurationExpression.AddMapsCore(IEnumerable`1 assembliesToScan)
at AutoMapper.MapperConfiguration.Build(Action`1 configure)
at GitReleaseManager.Core.AutoMapperConfiguration.Configure() in /_/src/GitReleaseManager.Core/AutoMapperConfiguration.cs:line 13
at GitReleaseManager.Cli.Program.RegisterServices(BaseSubOptions options) in /_/src/GitReleaseManager.Cli/Program.cs:line 76
at CommandLine.ParserResultExtensions.WithParsed[T](ParserResult`1 result, Action`1 action)
at GitReleaseManager.Cli.Program.<Main>d__1.MoveNext() in /_/src/GitReleaseManager.Cli/Program.cs:line 30
GitReleaseManager: Process returned an error (exit code 1).
Your Environment
Running this using cake (Cake.CoreCLR 1.1.0).
- Version Used: 0.12.0
- Edition Used .NET Core
- Operating System and version (Windows 10, Ubuntu 18.04): Windows 10
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Auto Mapper throwing ReflectionTypeLoadException on ...
I am trying to use Auto Mapper on .Net Core 2.2. Configuration: services.AddAutoMapper(cfg => { cfg.CreateMissingTypeMaps = false; cfg.
Read more >Error with Swagger UI with new application service #2304
LocalizationManager - Initialized localization source: Abp DEBUG 2017-01-18 ... An unhandled exception was thrown by the application.
Read more >Add AutoMapper to .Net 6
So basically we need to initialise the mapper with constructor initialisation. Then we need to utilise as follow. var _mappedUser = _mapper.Map ...
Read more >Neuron 3.7.5.686
FIX – Dependencies tab in Repository throws error - If user created a Data Mapper repository object in. Neuron Explorer but didn't create...
Read more >Azure Function Dependency Injection with AutoFac - codingsoul
Retrieve the LoaderExceptions property for more information. Exception type. System.Reflection.ReflectionTypeLoadException. Failed method
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 Free
Top 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
Huge thanks for @nils-a for finding the underlying problem here. This didn’t come up in the initial testing that was done prior to shipping 0.12.0 due to the fact that I was testing with the .NET Global Tool version of GitReleaseManager. This problem that we are seeing here is specific to the Full Fat .NET Framework version of the tool that is shipped to NuGet.org namely this one:
https://www.nuget.org/packages/GitReleaseManager/
We are away to publish a v0.12.1 release of GitReleaseManager which should fix this problem.
🎉 This issue has been resolved in version 0.12.1 🎉
The release is available on:
Your GitReleaseManager bot 📦🚀