6

为什么我不能将类型提供程序创建为带有[<TypeProviderAssembly()>][<EntryPoint>]内部的 *.exe 文件?

当我尝试使用 引用此类 TP#r @"d:\TP\bin\Debug\MyTypeProvider.exe"时,我看到以下内容:

test.fsx(3,1): error FS3031: The type provider 'd:\TP\bin\Debug\MyTypeProvider.exe' reported an error: Assembly attribute 'TypeProviderAssemblyAttribute' refers to a designer assembly 'MyTypeProvider' which cannot be loaded or doesn't exist. Could not load file or assembly 'file:///d:\TP\bin\Debug\MyTypeProvider.dll' or one of its dependencies. The system cannot find the file specified.

我需要在单独的进程中有一个类型推断运行时,因为它应该是64bit(与32bitVS 进程不同)。但我想将所有东西打包到一个文件中,从 VS 引用它并作为外部进程启动。

4

1 回答 1

2

Perhaps there's some good underlying reason for always looking for DLLs instead of EXEs, but I suspect this may be an arbitrary limitation.

I can get things to work in FSI if I supply the assembly's full name to the TypeProviderAssemblyAttribute constructor (e.g. [<TypeProviderAssembly("MyExe, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]), but IntelliSense doesn't work and I can't use the TP from other projects. Consider filing a bug with the team - but it would probably help if you could justify why you need an EXE instead of a DLL for your scenario.

于 2013-08-12T14:20:43.807 回答