Skip to content
This repository was archived by the owner on May 25, 2023. It is now read-only.

Commit 3d49487

Browse files
committed
Checking for any AutoMapper dependency; fixes #4
1 parent a4bcc3c commit 3d49487

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/AutoMapper.Extensions.Microsoft.DependencyInjection/ServiceCollectionExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public static void AddAutoMapper(this IServiceCollection services, Action<IMappe
3232
// Only load assemblies that reference AutoMapper
3333
.Where(lib =>
3434
lib.Type.Equals("msbuildproject", StringComparison.OrdinalIgnoreCase) ||
35-
lib.Dependencies.Any(d => d.Name.Equals(AutoMapperAssembly.GetName().Name)))
35+
lib.Dependencies.Any(d => d.Name.StartsWith(AutoMapperAssembly.GetName().Name, StringComparison.OrdinalIgnoreCase)))
3636
.SelectMany(lib => lib.GetDefaultAssemblyNames(dependencyContext)
3737
.Select(Assembly.Load)));
3838
}

src/AutoMapper.Extensions.Microsoft.DependencyInjection/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "1.1.1",
2+
"version": "1.1.2",
33
"authors": [ "Jimmy Bogard" ],
44
"copyright": "Copyright Jimmy Bogard",
55
"description": "AutoMapper extensions for ASP.NET Core",

0 commit comments

Comments
 (0)