F # compilation errors in Azure only when deploying with GitHub

I am deploying a C # site for Azure from the GitHub repository. This website links to a couple of F # libraries, and they just compile on my machine, but in Azure, the build fails with a number of compilation errors.

Here is a snippet of the build log:

FS0001: A generic construct requires that the type 'Company' have a public default constructor [C:\DWASFiles\Sites\eureka-servicestack-poc\VirtualDirectory0\site\repository\Eureka.ServiceStack.FSharp.Poc\Services\Services.fsproj] C:\DWASFiles\Sites\eureka-servicestack-poc\VirtualDirectory0\site\repository\Eureka.ServiceStack.FSharp.Poc\Services\CompaniesService.fs(28,17): error FS0039: The field, constructor or member 'PopulateWith' is not defined [C:\DWASFiles\Sites\eureka-servicestack-poc\VirtualDirectory0\site\repository\Eureka.ServiceStack.FSharp.Poc\Services\Services.fsproj] C:\DWASFiles\Sites\eureka-servicestack-poc\VirtualDirectory0\site\repository\Eureka.ServiceStack.FSharp.Poc\Services\AppHost.fs(17,55): error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved. [C:\DWASFiles\Sites\eureka-servicestack-poc\VirtualDirectory0\site\repository\Eureka.ServiceStack.FSharp.Poc\Services\Services.fsproj] An error has occurred during web site deployment. 

The first error should be fixed after I put the CLIMutable attribute in the violation record type, and the second error was fixed after the correct namespace was included. I do not know what the third error is about, especially since none of them occurs locally.

To make sure I had the same version of F # in both places, I included the FSharp.Core DLL in the solution and reference the local version. This did not help, but he removed the warning that he could not find version 4.3.1 of the file.

Is it possible that I am launching another version of the F # compiler and how can I check this? So far, it has worked fine, which makes me suspect some slight difference in versioning something. Unfortunately, it’s quite difficult to get an idea of ​​what is really going on in the build environment. This is a free Azure website, and you don’t think you are getting direct access to it.

I probably could solve some problems at the moment, but there seems to be a deeper problem here.

+4
source share
1 answer

This turned out to be a problem when using different versions of the F # compiler. Using Visual Studio 2013 RC, I used version 3.1, which had some improvements as a result of which my specific problems did not appear.

The problem was difficult because changing my F # project to use compiler 3.0 in Visual Studio had no effect (it was still compiled just fine). I even opened the solution in Visual Studio 2012, and it all worked out quite well. Only when I created a new project from scratch in VS 2012 did I start getting the same compilation errors as on the server. Therefore, I assume that this should be an error (or at least not a very desirable function) in the project file that was created. I'm not sure if this should be classified as a bug with VS 2013, especially since I don’t know exactly what causes the error.

So, a simple pre-Azure solution (or is this Kudu thing?) Supports compiler 3.1 to either recreate the project file in VS 2012, or copy code that does not compile into a test solution where patches can be tested.

+1
source

All Articles