F # type provider compiled as * .exe file

Why can't I create a Type Provider as a * .exe file with [<TypeProviderAssembly()>] and [<EntryPoint>] inside?

When I try to reference such TP using #r @"d:\TP\bin\Debug\MyTypeProvider.exe" , I see the following:

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.

I need to have type inference output mode in a separate process, because it must be 64bit (unlike the 32bit VS process). But I want to pack all things into one file, link to it from VS and run as an external process.

+6
source share
1 answer

There may be some good reason to always look for a DLL instead of an EXE, but I suspect this could be an arbitrary limitation.

I can get the work to work in FSI if I put the full name of the assembly in the TypeProviderAssemblyAttribute constructor (for example, [<TypeProviderAssembly("MyExe, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>] ), but IntelliSense does not work , and I can not use TP from other projects. Consider the issue of error with the command - but this will probably help if you can justify why for your script you need an EXE rather than a DLL.

+2
source

Source: https://habr.com/ru/post/951538/


All Articles