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.

AutoMapper 8.1.1 is not compatible with IS4, yet

See original GitHub issue

It appears that IS4 has an issue with the latest release of AutoMapper

  • Your Abp package version: 4.7.0
  • Your base framework: .Net Core - 2.2.6/2.2.301

https://github.com/aspnetboilerplate/aspnetboilerplate/commit/284a1cb2b6ddf35d0a82c3e424e832579e91a8f0

https://github.com/IdentityServer/IdentityServer4/issues/2812

ERROR Microsoft.AspNetCore.Server.Kestrel - Connection id "0HLO5DL0AMC7Q", Request id "0HLO5DL0AMC7Q:00000005": An unhandled exception was thrown by the application.
System.TypeInitializationException: The type initializer for 'IdentityServer4.EntityFramework.Mappers.ClientMappers' threw an exception. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.MissingMethodException: Method not found: 'AutoMapper.IMappingExpression`2<!0,!1> AutoMapper.IMappingExpression`2.ConstructUsing(System.Linq.Expressions.Expression`1<System.Func`2<!0,!1>>)'.
   at IdentityServer4.EntityFramework.Mappers.ClientMapperProfile..ctor()
   --- End of inner exception stack trace ---
   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean wrapExceptions, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor)
   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean wrapExceptions, Boolean skipCheckThis, Boolean fillCache)
   at System.Activator.CreateInstance[T]()
   at AutoMapper.Configuration.MapperConfigurationExpression.AddProfile[TProfile]() in C:\projects\automapper\src\AutoMapper\Configuration\MapperConfigurationExpression.cs:line 49
   at AutoMapper.MapperConfiguration.Build(Action`1 configure) in C:\projects\automapper\src\AutoMapper\MapperConfiguration.cs:line 322
   at AutoMapper.MapperConfiguration..ctor(Action`1 configure) in C:\projects\automapper\src\AutoMapper\MapperConfiguration.cs:line 60
   at IdentityServer4.EntityFramework.Mappers.ClientMappers..cctor() in C:\local\identity\server4\IdentityServer4\src\EntityFramework.Storage\src\Mappers\ClientMappers.cs:line 16
   --- End of inner exception stack trace ---
   at IdentityServer4.EntityFramework.Mappers.ClientMappers.ToModel(Client entity) in C:\local\identity\server4\IdentityServer4\src\EntityFramework.Storage\src\Mappers\ClientMappers.cs:line 29
   at IdentityServer4.EntityFramework.Stores.ClientStore.FindClientByIdAsync(String clientId) in C:\local\identity\server4\IdentityServer4\src\EntityFramework.Storage\src\Stores\ClientStore.cs:line 59
   at IdentityServer4.Stores.ValidatingClientStore`1.FindClientByIdAsync(String clientId) in C:\local\identity\server4\IdentityServer4\src\IdentityServer4\src\Stores\ValidatingClientStore.cs:line 52
   at IdentityServer4.Stores.IClientStoreExtensions.FindEnabledClientByIdAsync(IClientStore store, String clientId) in C:\local\identity\server4\IdentityServer4\src\IdentityServer4\src\Extensions\IClientStoreExtensions.cs:line 23
   at IdentityServer4.Validation.ClientSecretValidator.ValidateAsync(HttpContext context) in C:\local\identity\server4\IdentityServer4\src\IdentityServer4\src\Validation\Default\ClientSecretValidator.cs:line 67
   at IdentityServer4.Endpoints.TokenEndpoint.ProcessTokenRequestAsync(HttpContext context) in C:\local\identity\server4\IdentityServer4\src\IdentityServer4\src\Endpoints\TokenEndpoint.cs:line 78
   at IdentityServer4.Endpoints.TokenEndpoint.ProcessAsync(HttpContext context) in C:\local\identity\server4\IdentityServer4\src\IdentityServer4\src\Endpoints\TokenEndpoint.cs:line 70
   at IdentityServer4.Hosting.IdentityServerMiddleware.Invoke(HttpContext context, IEndpointRouter router, IUserSession session, IEventService events) in C:\local\identity\server4\IdentityServer4\src\IdentityServer4\src\Hosting\IdentityServerMiddleware.cs:line 54
   at IdentityServer4.Hosting.IdentityServerMiddleware.Invoke(HttpContext context, IEndpointRouter router, IUserSession session, IEventService events) in C:\local\identity\server4\IdentityServer4\src\IdentityServer4\src\Hosting\IdentityServerMiddleware.cs:line 69
   at IdentityServer4.Hosting.MutualTlsTokenEndpointMiddleware.Invoke(HttpContext context, IAuthenticationSchemeProvider schemes) in C:\local\identity\server4\IdentityServer4\src\IdentityServer4\src\Hosting\MtlsTokenEndpointMiddleware.cs:line 60
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at IdentityServer4.Hosting.BaseUrlMiddleware.Invoke(HttpContext context) in C:\local\identity\server4\IdentityServer4\src\IdentityServer4\src\Hosting\BaseUrlMiddleware.cs:line 36
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at U2U.AspNetCore.Security.Headers.ResponseHeadersMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Builder.Extensions.MapWhenMiddleware.Invoke(HttpContext context)
   at Abp.AspNetCore.Security.AbpSecurityHeadersMiddleware.Invoke(HttpContext httpContext) in D:\Github\aspnetboilerplate\src\Abp.AspNetCore\AspNetCore\Security\AbpSecurityHeadersMiddleware.cs:line 26
   at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
malimingcommented, Jul 13, 2019
0reactions
ismcagdascommented, Jul 15, 2019
Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Error when installing Automapper 8.1.1 with package ...
I used the package manager in VS Code to install the latest version of automapper. I was on 8.0.1 and now I want...
Read more >
8.1.1 Upgrade Guide
1 Upgrade Guide. The purpose of this release is to allow you to upgrade to 9.0 gradually.
Read more >
11.0 Upgrade Guide
TypeConverter is no longer supported¶. It was removed for performance reasons. So it's best not to use it anymore. But if you must,...
Read more >
AutoMapper — AutoMapper documentation
A convention-based object-object mapper. AutoMapper uses a fluent configuration API to define an object-object mapping strategy. AutoMapper uses a convention- ...
Read more >
Add AutoMapper to .Net 6
In this article we will be adding AutoMapper to our AspNetCore 6 application. You can watch the full video on Youtube.
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