I'm trying to use the Azure Storage type provider in my F# project:
Install-Package FSharp.Azure.StorageTypeProvider
It works locally, but when I deploy from my local Git repository to my Azure web app, I get the following errors
remote: Updating branch 'master'.
remote: Updating submodules.
remote: Preparing deployment for commit id 'f67901b428'.
remote: Generating deployment script.
remote: Running deployment command...
remote: Handling .NET Web Application deployment.
remote: All packages listed in packages.config are already installed.
remote: All packages listed in packages.config are already installed.
remote: D:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3247: Found conflicts between different versions of the same dependent assembly. [D:\home\site\repository\FlunSharp\FlunSharp.fsproj]
remote: FSC : error FS3031: The type provider 'D:\home\site\repository\packages\FSharp.Azure.StorageTypeProvider.1.2.0\lib\net40\FSharp.Azure.StorageTypeProvider.dll' reported an error: Assembly attribute 'TypeProviderAssemblyAttribute' refers to a designer assembly 'FSharp.Azure.StorageTypeProvider' which cannot be loaded or doesn't exist. Could not load file or assembly 'FSharp.Core, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. [D:\home\site\repository\FlunSharp\FlunSharp.fsproj]
remote: FSC : warning FS3005: Referenced assembly 'D:\home\site\repository\packages\FSharp.Azure.StorageTypeProvider.1.2.0\lib\net40\FSharp.Azure.StorageTypeProvider.dll' has assembly level attribute 'Microsoft.FSharp.Core.CompilerServices.TypeProviderAssemblyAttribute' but no public type provider classes were found [D:\home\site\repository\FlunSharp\FlunSharp.fsproj]
remote: Failed exitCode=1, command="D:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" "D:\home\site\repository\FlunSharp\FlunSharp.fsproj" /nologo /verbosity:m /t:Build /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="D:\local\Temp\3ec76803-496c-41df-ad73-f8bc79256ad9";AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release /p:SolutionDir="D:\home\site\repository.\"
remote: An error has occurred during web site deployment.
remote:
remote: Error - Changes committed to remote repository but deployment to website failed.
Any suggestions?
We talked about this in the chat here
Basically this was an issue in how MSBuild on the server detects the right F# compiler to build the project with (3.0 vs 3.1)
A work around is to specify another MSBuild version through setting an app setting on the site that looks like this
MSBUILD_PATH = D:\Program Files (x86)\MSBuild\12.0\Bin\amd64\MSBuild.exe
However, the right fix should go in the
fsproj
file. In particular this sectionShould be updated to
I think this is an issue with WebSharper templates that don't set the correct visual studio version in the project file.