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

Commit a4bcc3c

Browse files
committed
Always adding msbuild projects to scan; fixes #2
1 parent 6a31c00 commit a4bcc3c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ public static void AddAutoMapper(this IServiceCollection services, Action<IMappe
3030
services.AddAutoMapper(additionalInitAction,
3131
dependencyContext.RuntimeLibraries
3232
// Only load assemblies that reference AutoMapper
33-
.Where(lib => lib.Dependencies.Any(d => d.Name.Equals(AutoMapperAssembly.GetName().Name)))
33+
.Where(lib =>
34+
lib.Type.Equals("msbuildproject", StringComparison.OrdinalIgnoreCase) ||
35+
lib.Dependencies.Any(d => d.Name.Equals(AutoMapperAssembly.GetName().Name)))
3436
.SelectMany(lib => lib.GetDefaultAssemblyNames(dependencyContext)
3537
.Select(Assembly.Load)));
3638
}

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.0",
2+
"version": "1.1.1",
33
"authors": [ "Jimmy Bogard" ],
44
"copyright": "Copyright Jimmy Bogard",
55
"description": "AutoMapper extensions for ASP.NET Core",

0 commit comments

Comments
 (0)