Search code examples
xamarinxamarin.androidportable-class-libraryreflection.emit

Why Reflection.Emit is not available on Xamarin.Android portable project?


I know that Android supports JIT so Reflection.Emit should be available on that platform. But when I select .NET 4 + Xamarin.Android targets in Portable Class Library project properties I can't use Reflection.Emit.


Solution

  • This is because Visual Studio adds other platforms (like iOS) that doesn't support System.Reflection.Emit to the target Profile.

    enter image description here

    If you want to use this API, go for a shared project or use file linking.