toddams / RazorLight

Template engine based on Microsoft's Razor parsing engine for .NET Core
Apache License 2.0
1.5k stars 259 forks source link

Assembly name comparison #439

Open Sten-V opened 3 years ago

Sten-V commented 3 years ago

Is it possible that this call to Contains(...) instead should be a call to Equals(...), or is this intentional? https://github.com/toddams/RazorLight/blob/22381db30ca3c61b4b1e4004e1536407dd138e49/src/RazorLight/Compilation/DefaultMetadataReferenceManager.cs#L105

toddams commented 3 years ago

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

Sten-V commented 3 years ago

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.

toddams commented 3 years ago

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