Skip to content

Commit

Permalink
Applied hotfix detailed at Antaris#526
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinMellott91 committed Jul 31, 2018
1 parent aa5dd26 commit 8f33d6c
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ public IEnumerable<CompilerReference> GetReferences(TypeContext context = null,
{
return CompilerServicesUtility
.GetLoadedAssemblies()
.Where(a => !a.IsDynamic && File.Exists(a.Location) && !a.Location.Contains(CompilerServiceBase.DynamicTemplateNamespace))
// Hotfix applied from https://github.com/Antaris/RazorEngine/issues/526
//.Where(a => !a.IsDynamic && File.Exists(a.Location) && !a.Location.Contains(CompilerServiceBase.DynamicTemplateNamespace))
.Where(a => !a.IsDynamic && !a.FullName.Contains("Version=0.0.0.0") && File.Exists(a.Location) && !a.Location.Contains("CompiledRazorTemplates.Dynamic"))
.GroupBy(a => a.GetName().Name).Select(grp => grp.First(y => y.GetName().Version == grp.Max(x => x.GetName().Version))) // only select distinct assemblies based on FullName to avoid loading duplicate assemblies
.Select(a => CompilerReference.From(a))
.Concat(includeAssemblies ?? Enumerable.Empty<CompilerReference>());
Expand Down

1 comment on commit 8f33d6c

@martingp
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible get a release created with this latest hotfix so it shows up in the nuget manager in Visual Studio?

Please sign in to comment.