vendredi 12 avril 2019

Reflect on netCore assembly from netFx runtime

I have an MSBuild task that performs some code-gen. Being an MSbuild task implies that it will be running a dotNET framework (not dotNET core) process. The task needs to reflect on some assemblies which will provide input for the code generator function.

This works when the target assembly is a dotNET framework assembly. However, I'm trying to port this code to netcoreapp, and it fails because I cannot reflect on the types in a dotNET core assembly from dotNET framework code. I get loader exceptions that it cannot resolve System.Runtime.

I only need the metadata about the types in the assembly, I don't actually need to load them. Is there an alternative to reflection that would work in this scenario?





Aucun commentaire:

Enregistrer un commentaire