Skip to content

Commit

Permalink
Merge pull request #24 from dd4t/bug/23-locking
Browse files Browse the repository at this point in the history
load the assembly indirectly to avoid locking
  • Loading branch information
quirijnslings authored May 15, 2020
2 parents 37284ca + 7324962 commit f656390
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion source/DD4T.DI.Autofac/Bootstrap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ public static void UseDD4T(this ContainerBuilder builder)
if (file == null)
throw new ProviderNotFoundException();

var load = Assembly.LoadFile(file);
// do NOT load the assembly with Assembly.LoadFile, because IIS will lock the DLL
// See https://stackoverflow.com/questions/1031431/system-reflection-assembly-loadfile-locks-file
var load = Assembly.Load(System.IO.File.ReadAllBytes(file));

builder.RegisterProviders();
builder.RegisterFactories();
Expand Down

0 comments on commit f656390

Please sign in to comment.