I’m trying to deploy an MVC4 web application to Azure. It has a dependency on an F# project (houses the controllers for the MVC app) which keeps failing to build w/ error:
C:\DWASFiles\Sites\jbf\VirtualDirectory0\site\repository\JBF.Web\JBF.Web.Controllers\JBF.Web.FSharp.fsproj : error MSB4057: The target “Build” does not exist in the project.
The project(s) exist in VS2012 which forces the upgrade of F# projects. I’m wondering if this is a dependency that Azure doesn’t support yet with all of the 4.5 refs found in the import statements from the fsproj:
<Import Project="$(MSBuildExtensionsPath32)\..\Microsoft F#\v4.5\Microsoft.FSharp.Targets" Condition="Exists('$(MSBuildExtensionsPath32)\..\Microsoft F#\v4.5\Microsoft.FSharp.Targets')" />
<Import Project="$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets" Condition="Exists('$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets')" />
<Import Project="$(MSBuildExtensionsPath32)\..\Microsoft F#\v4.0\Microsoft.FSharp.Targets" Condition="(!Exists('$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets')) And (Exists('$(MSBuildExtensionsPath32)\..\Microsoft F#\v4.0\Microsoft.FSharp.Targets'))" />
<Import Project="$(MSBuildExtensionsPath32)\FSharp\1.0\Microsoft.FSharp.Targets" Condition="(!Exists('$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets')) And (!Exists('$(MSBuildExtensionsPath32)\..\Microsoft F#\v4.0\Microsoft.FSharp.Targets')) And (Exists('$(MSBuildExtensionsPath32)\FSharp\1.0\Microsoft.FSharp.Targets'))" />
For the record if I pre-build the DLL and deploy that (with a reference to the DLL instead of the project) it works just fine. Also, the fsproj has no actual dependency on F# 3.0 (it’s an F# 2.0 project migrated to VS2012).
Update: this issue is tracked by https://github.com/projectkudu/kudu/issues/137
I just reproed this. Here is the sample repo: https://github.com/KuduApps/WebAppWithFSharpLibrary.
It’s definitely a bug. Could you please open an issue on https://github.com/projectkudu/kudu to track this? It’s best to track issue there then as StackOverflow questions. Thanks!