Reuse compiled assembly again if no changes are detected

It's not pretty, but it works...
This commit is contained in:
Nikolaj
2020-09-03 10:31:45 +02:00
parent 624e57f304
commit aa1807bd5a
2 changed files with 39 additions and 20 deletions

View File

@@ -397,6 +397,7 @@ namespace Umbraco.ModelsBuilder.Embedded
// directory, and then we end up referencing a dll which is *not* in that
// directory, and BuildManager fails to instantiate views ("the view found
// at ... was not created").
// TODO: Since we use Roslyn Compiler now, instead of BuildManager this shouldn't matter anymore??
//
if (File.Exists(dllPathFile))
{
@@ -405,7 +406,7 @@ namespace Umbraco.ModelsBuilder.Embedded
_logger.Debug<PureLiveModelFactory>($"Cached models dll at {dllPath}.");
if (File.Exists(dllPath) && !File.Exists(dllPath + ".delete") && dllPath.StartsWith(codegen))
if (File.Exists(dllPath) && !File.Exists(dllPath + ".delete") /*&& dllPath.StartsWith(codegen)*/)
{
assembly = Assembly.LoadFile(dllPath);
var attr = assembly.GetCustomAttribute<ModelsBuilderAssemblyAttribute>();