2

I'm working on upgrading FSharp.Data.SqlClient to the latest version of the Type Provider SDK and I'm seeing an error when using generated types. The test project, which references numerous generated types, compiles just fine, but when I attempt to run the xunit tests I get the following exception:

System.TypeLoadException: Could not load type 'BTL' from assembly 'SqlClient.Tests, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' because the parent does not exist. at System.Reflection.RuntimeAssembly.GetExportedTypes(RuntimeAssembly assembly, ObjectHandleOnStack retTypes) at System.Reflection.RuntimeAssembly.GetExportedTypes() at <StartupCode$FSI_0005>.$FSI_0005.main@()

I'm not sure what the type BTL refers to - I don't see any symbol with that name anywhere in the test or in the type provider source. And I've confirmed that the issue is related to generated types - if I comment out all references to SqlEnumProvider but leave references to erased types, the tests all pass.

4

1 回答 1

0

发现度量单位生成的类型存在问题 - 这些提供的类型的基本类型是None在反映程序集类型时导致错误的。更改基本类型以Some typedefof<obj>解决问题,现在所有测试都通过了。

顺便说一句,神秘BTL类型来自测试数据库中的数据,回想起来似乎很明显。

于 2018-10-24T15:43:19.970 回答