toddams/RazorLight

Assembly name comparison

Sten-V opened this issue · 3 comments

Is it possible that this call to Contains(...) instead should be a call to Equals(...), or is this intentional?

if (excludedAssemblies.Any(s => s.Contains(assemblyRef.Name))) { continue; }

excludedAssemblies is a collection, assemblyRef.Name is a string. This is intentional

Yes, but the Contains(...) is not performed directly on that collection, it done on every string in that collection the way it looks now.
And because it is a Contains(...) comparison between two strings it's quite possible to exclude more assemblies than the consuming code intended.

Sorry, I actually overlooked the point. It's indeed weird, I'll double-check