Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Usage of TypeInfo members is incorrectly reported as not supported when analyzing .NET Framework assemblies #113

Closed
dsplaisted opened this issue Aug 14, 2015 · 2 comments

Comments

@dsplaisted
Copy link
Member

A bunch of APIs on Type are not supported in .NET Core. Running ApiPort on an assembly that uses these types will recommend adding a call to GetTypeInfo(). Doing so will indeed make the code portable to .NET Core. However, running the portability analyzer on an assembly that does call GetTypeInfo() for these APIs will still report them as unsupported.

This is because for the .NET Framework, TypeInfo derives from Type and simply inherits those APIs. So in the method table you never see TypeInfo.get_Assembly, just Type.get_Assembly even if you are accessing it via a TypeInfo object.

To report portability of these APIs correctly would probably require analyzing the IL at the call sites.

The APIs on Type are some of the most common ones encountered that aren't supported on .NET Core. So this issue makes it hard to use ApiPort to track progress towards .NET Core compatibility.

@weshaggard
Copy link
Member

I suspect the best way to actually fix this is to add the overrides in the full framework itself so that these show up as calls to TypeInfo. Baring that I don't see any clean way to do this directly in ApiPort itself that isn't a big hack.

@conniey
Copy link
Member

conniey commented Jun 5, 2017

Known limitation of the catalog.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants