Search code examples
f#type-providers

Not being able to build F# type provider SDK


I have finally come across something that no one else seemed to have come across (at least from what I can tell). I trying to build an F# type provider using TypeProviders.SDK.

As soon as I build the solution I get the error: "FS0810, Property 'CultureName' cannot be set, \LemonadeProvider\paket-files\fsprojects\FSharp.TypeProviders.SDK\src\ProvidedTypes.fs" on line 2090 and again at 3162 in the design time project of the solution.

I do not think this is useful but the Test project also fails as it can not find the LemonadeProvider.Runtime.dll. I am assuming this will get created when the Runtime project will build successfully.

PS: As of right now I am just tring to build the provided template, I have not changed the code or added anything to it. Hence I have not attached any code, but please feel free to ask for it.


Solution

  • I found out that the issue lied with the ProvidedTypes.fs and ProvidedTypes.fsi files created by the SDK.

    The issue was solved for me when I replaced the files with the ones found in 'SDK-dsyme-patch-7' which provided compatibility for different .Net environments which was missing from the original SDK. There might be other differences but this is the one I found and it fixed the problem for me. The files can be found under '/src/' in the dsyme patch.

    The code I am referring to is as follows and has been added twice to the ProvidedTypes.fs:

    #if NETSTANDARD
                asmName.CultureName <- System.Globalization.CultureInfo.InvariantCulture.Name
        #else
                asmName.CultureInfo <- System.Globalization.CultureInfo.InvariantCulture
        #endif
                asmName
    

    I am not aware if there is a new SDK that has solved the problem. But at the time when the question was asked, this is what worked for me.