CreateType missing from TypeBuilder. How to port this?
Asked Answered
G

1

16

Trying to port an application from .net 4.5 to .net core for a client. I'm noticing that CreateType is no longer part of TypeBuilder. I've searched through multiple of the new reflection libs with no luck. Does anyone know how to port this?

Code in question:

typeBuilder.CreateType()
Gratiana answered 27/5, 2016 at 16:35 Comment(0)
G
39

I found the answer, but in a different repository than I expected. CreateType was dropped, and CreateTypeInfo should be used now per this:

https://github.com/dotnet/coreclr/issues/2222

'TypeBuilder' does not contain a definition for 'CreateType' and no extension method 'CreateType' accepting a first argument of type 'TypeBuilder' could be found (are you missing a using directive or an assembly reference?)

Use typeBuilder.CreateTypeInfo() instead.

Hope this saves someone else time.

Gratiana answered 27/5, 2016 at 17:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.