-
Notifications
You must be signed in to change notification settings - Fork 90
Open
Labels
Description
Description
The WsdlProvider is a generative provider due to the use of WCF. To implement Wsdl Choice elements, some properties must have an attribute referencing the Type of provided classes.
When generating the typeof, the namespace emitted is the generic one used in the TP, but the type is actually emitted in the user's code namespace. When used, the actual type cannot be found.
Repro steps
- Create a generative TP type provider
- In the type generation, create a ProvidedTypeDefinition call MyObject in TpNS namespace
- In a provided function, emit a typeof this type.
- Write a sample that use the type provider in a Sample namespace
Expected behavior
When running the sample, the type should be found in the Sample namespace
Actual behavior
The typeof jitting will fail, indicating that the type TpNS.MyObject cannot be found. The class is actually in Sample.MyObject.
Known workarounds
There is no known workaround.
Is there a way to get the actual namespace where the generated code will be compiled ? Is this information available in the TypeProvider ?
Related information
- All
- main
- .NET Runtime & CoreCLR at least