You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there any chance that this is an assembly reference that does not end up in build output?
High chance it will run against a different version with a different set of private members, e.g. the BCL. ❌ Cannot prove nonexistence.
Going to the GAC to go around this is even worse IMO.
If I'm targeting net472 and doing GetType on some type that will never exist in net472, the situation clearly shows that I'm expecting the same assembly to sometimes run on net48 and that I expect to handle the situation in which the type doesn't exist.
A stronger example of this is NUnitLite's .NET Standard build which uses reflection to detect whether it is on .NET Core and if so, drive AssemblyLoadContext using reflection.
Compilation.MetadataImportOptions
will be public so we can check.[ReferenceAssembly]
if present we can perhaps try to resolve from the GAC and use refelection.http://source.roslyn.io/#Microsoft.CodeAnalysis/MetadataReader/MetadataImportOptions.cs,05f2bcc4af4b3736
https://github.com/dotnet/roslyn/blob/master/docs/features/refout.md#definition-of-ref-assemblies
The text was updated successfully, but these errors were encountered: