fsprojects-archive / zzarchive-FSharpCommunityTemplates

Templates for F# projects, by the F# community, for use in Visual Studio, Xamarin Studio and other editors
MIT License
103 stars 27 forks source link

Publishing to Azure with Pure F# MVC 5 and Web API 2 Templates Fails #28

Closed dmohl closed 10 years ago

panesofglass commented 10 years ago

Is this web sites, roles, or both?

dmohl commented 10 years ago

Good question. I haven't had a chance to look into this yet. I'm logging the issue based on a few reports from others including Mark's post (http://blog.ploeh.dk/2013/08/26/running-a-pure-f-web-api-on-azure-web-sites/). We'll need to explore the extent of the issue(s).

panesofglass commented 10 years ago

Oh, okay. I think those things are already accommodated in the template. At least one of the ones I sent originally had those targets. I think. :) Build actions are another matter. I didn't read through those very well.

panesofglass commented 10 years ago

The MVC5 templates appear to be configured correctly from a read of the .fsproj file.

ghost commented 10 years ago

The pure f# templates hit a limitation in the F# VS project support when doing direct publishing.

I published using github hooks to azure which is better anyway.

panesofglass commented 10 years ago

I just did the same from VSOnline. I had to add a reference to the FSharp.Core.3 NuGet package since my VS2013 project was using F# 3.1. I could probably have used Copy Local in the project settings, too. http://fsharpweb2.azurewebsites.net/

jackfoxy commented 10 years ago

FSharp.Core reference is set to Copy Local true, and I am getting "Specified cast is not valid" error during publish.

ghost commented 10 years ago

This is a known limitation of the Visual F# Tools project system implementation. They are looking into it.

In the meantime, just publish by somme other route, e.g. by pushing to GitHub and using a service hook.

jackfoxy commented 10 years ago

@dsyme @panesofglass is that to say adding FSharp.Core.3.1 NuGet package to project also does not work? I have located the 3.0 NuGet package, but not the 3.1 package yet.

ghost commented 10 years ago

My comment was not related to FSharp.Core, just the "publish" functionality in Visual Studio.

jackfoxy commented 10 years ago

@dsyme I was trying to interpret @panesofglass previous comment which might have suggested adding this package solved the publish problem. Looking into publishing from GIt now.

jackfoxy commented 10 years ago

I talked this over with the F# team today. In the future the protocol we should follow for high profile bugs is for an MVP to log the problem in MVP Connect. This puts it on management radar. I have logged this to MVP connect (I think it should be available in all MS Connect). https://connect.microsoft.com/VisualStudio/feedback/details/813846/azure-publish-from-vs-2013-ide-fails-for-certain-f-projects Please go to and upvote and if appropriate add any supporting information. The F# team has a solution, it is not fully tested and ready for deployment. Let's help them move this through the system.

TWith2Sugars commented 10 years ago

I've hit the same problem but cannot use webhooks as I'm using a CI tool to build/test/deploy. What is the solution the F# team has come up with? and an ETa of when this will be available?

ghost commented 10 years ago

Can you use FTP or some other technique to push your code to the CI server?

TWith2Sugars commented 10 years ago

I've created a Proxy C# Project that references the F# project and then WebDeploy the C# project . That seems to work fine for now.

sayedihashimi commented 10 years ago

OK I'm able to repro this now. I investigated a bit. The exception is being raised from the RefreshSolutionExplorer method. It looks like the F# project system is returning E_NOTIMPL which is being converted to a NotImplementedException. Instead of returning E_NOTIMPL can you return S_OK?

Exception details: System.NotImplementedException occurred Message: A first chance exception of type 'System.NotImplementedException' occurred in FSharp.ProjectSystem.Base.dll Additional information: The method or operation is not implemented.

sayedihashimi commented 10 years ago

I talked to Kevin Ransom as requested here and he stated that F# does not yet fully support Web projects. This is planned for the next release of F# tooling.

Since there is nothing that my team can do here I have resolved the Connect bug. Once F# web support is implemented, if you have any issues please open a new bug.

kunjee17 commented 10 years ago

Hi, I don't know this question belongs here but while deploying to azure using git web hook (using bit bucket) I am getting this error "error MSB4057: The target "pipelinePreDeployCopyAllFilesToOneFolder" does not exist in the project." any idea how to solve it? Or even I can debug it. I am trying to deploy Nancy project.

Please let me know if any further information is required.

kunjee17 commented 10 years ago

I was able to solve the issue. I posted details over my blog. If anyone interested.

panesofglass commented 10 years ago

You can find a preview of the F# Tools with a fix on CodePlex.