It all works in Visual Studio. Just create an ASP.NET/C# web site, then add an F# project, and in the F# project settings direct the compiler output to the Bin of the web site.
will i need to fiddle with asp.net code to get it all working. or everything is taken care by F#
I am delighted to get a reply to this four years after I posted! I can still remember posting it. :)
I don't have Visual Studio in front of me as I'm on holiday, but what I posted is still correct. I have since deployed a much larger asp.net mvc project to Azure with a mix of C# and F#.
Just set the asp.net/c# project as the main project in the solution (I can't recall exactly what the setting is, but it's a right-click from the project in the solution explorer) and then in the Properties for the F# project direct the compiler output to the bin of the C# project.
You can't reference the f# project directly from asp.net/c#. You need to reference the DLL's (in the bin folder) from the C# and import them with web.config of the ASP.NET.
Thanks again, and good luck with it! I personally found it very worthwhile to be doing much of the solution in F#.
I don't have Visual Studio in front of me as I'm on holiday, but what I posted is still correct. I have since deployed a much larger asp.net mvc project to Azure with a mix of C# and F#.
Just set the asp.net/c# project as the main project in the solution (I can't recall exactly what the setting is, but it's a right-click from the project in the solution explorer) and then in the Properties for the F# project direct the compiler output to the bin of the C# project.
You can't reference the f# project directly from asp.net/c#. You need to reference the DLL's (in the bin folder) from the C# and import them with web.config of the ASP.NET.
Thanks again, and good luck with it! I personally found it very worthwhile to be doing much of the solution in F#.
>> You can't reference the f# project directly from asp.net/c#.
In VS2013 you can reference an F# project from a C# project in the same solution. Use the normal sequence from the C# project, ie. right-click References -> Add Reference, and then in the 'Project' tab check the F# project.
This works for local testing (with F5) and I suspect would also manage deployment for you.
In VS2013 you can reference an F# project from a C# project in the same solution. Use the normal sequence from the C# project, ie. right-click References -> Add Reference, and then in the 'Project' tab check the F# project.
This works for local testing (with F5) and I suspect would also manage deployment for you.
so any asp.net hosting will do or something specific is required for F#. are there any memory requirements for F#
so any asp.net hosting will do or something specific is required for F#. are there any memory requirements for F#
It's all IL in the end, so long as you are deploying assemblies. Just make sure to include FSharp.Core.dll, as some machines may not have the F# tools installed.
Also, you may find that the F# MVC 5 template works with most hosts: This template gives you C#-based Razor views in an all F# project. We are currently working out the Web/Azure Deploy kinks. Otherwise, this template even runs on Azure (using Git deployment, for example).
so any asp.net hosting will do or something specific is required for F#. are there any memory requirements for F#
Nope! The small project I described in the post was deployed to a standard ASP.NET commercial host and my current project is deployed to Azure. Deploy your asp.net/C# as the root of the web site, and manually deploy the F# DLL's to the Bin. I was not able to get automatic VS deployment working in VS2010 or 2012, even for a pure asp.net/C# project, and I used ftp to build the web site structure on the host. You deploy the .aspx and C# files as normal, and manually copy the F# dll's to the Bin on the host. It's a bit of a pain at first, but once you've got it working it is quite easy to update it.
Topic tags
- f# × 3681
- compiler × 265
- functional × 201
- websharper × 158
- c# × 119
- classes × 97
- web × 95
- book × 84
- .net × 82
- async × 72
- parallel × 43
- server × 43
- parsing × 41
- testing × 41
- asynchronous × 30
- monad × 28
- ocaml × 28
- haskell × 26
- tutorial × 26
- html × 23
- workflows × 22
- linq × 21
- fpish × 19
- introduction × 19
- silverlight × 19
- wpf × 19
- collections × 14
- pipeline × 14
- templates × 12
- monads × 11
- opinion × 10
- reactive × 10
- plugin × 9
- scheme × 9
- sitelets × 9
- solid × 9
- basics × 8
- concurrent × 8
- deployment × 8
- how-to × 8
- javascript × 8
- python × 8
- complexity × 7
- jquery × 7
- lisp × 6
- real-world × 6
- scala × 6
- workshop × 6
- xaml × 6
- conference × 5
- dsl × 5
- java × 5
- metaprogramming × 5
- ml × 5
- piglets × 5
- visual studio × 5
- formlets × 4
- fsi × 4
- lift × 4
- sitelet × 4
- sql × 4
- teaching × 4
- alt.net × 3
- aml × 3
- enhancement × 3
- erlang × 3
- highcharts × 3
- list × 3
- piglet × 3
- reflection × 3
- type provider × 3
- azure × 2
- blog × 2
- clojure × 2
- compilation × 2
- computation expressions × 2
- corporate × 2
- courses × 2
- cufp × 2
- enterprise × 2
- entity framework × 2
- events × 2
- f# interactive × 2
- fsc × 2
- google maps × 2
- hosting × 2
- html5 × 2
- http × 2
- interactive × 2
- interface × 2
- iphone × 2
- iteratee × 2
- jobs × 2
- kendo × 2
- keynote × 2
- mvc × 2
- numeric × 2
- obfuscation × 2
- oop × 2
- packaging × 2
- pattern matching × 2
- performance × 2
- pipelines × 2
- rest × 2
- rx × 2
- script × 2
- seq × 2
- sockets × 2
- stm × 2
- tcp × 2
- trie × 2
- type × 2
- typescript × 2
- xna × 2
- zh × 2
- .net interop × 1
- 2012 × 1
- abstract class × 1
- accumulator × 1
- active pattern × 1
- addin × 1
- agents × 1
- agile × 1
- alter session × 1
- android × 1
- anonymous object × 1
- appcelerator × 1
- architecture × 1
- array × 1
- arrays × 1
- asp.net 4.5 × 1
- asp.net integration × 1
- asp.net mvc × 1
- asp.net mvc 4 × 1
- asp.net web api × 1
- aspnet × 1
- ast × 1
- b-tree × 1
- badimageformatexception × 1
- batching × 1
- bistro × 1
- bootstrap × 1
- bug × 1
- bundle × 1
- camtasia studio × 1
- canvas × 1
- class × 1
- client × 1
- clojurescript × 1
- closures × 1
- cloud × 1
- cms × 1
- coding diacritics × 1
- color highlighting × 1
- combinator × 1
- confirm × 1
- constructor × 1
- continuation-passing style × 1
- coords × 1
- coursera × 1
- csla × 1
- css × 1
- current_schema × 1
- custom content × 1
- data × 1
- database × 1
- declarative × 1
- delete × 1
- dhtmlx × 1
- discriminated union × 1
- disqus × 1
- distance × 1
- docs × 1
- documentation × 1
- dol × 1
- dom × 1
- domain × 1
- du × 1
- duf-101 × 1
- eclipse × 1
- edsl × 1
- em algorithm × 1
- emacs × 1
- emotion × 1
- error × 1
- etw × 1
- euclidean × 1
- event × 1
- example × 1
- examples × 1
- ext js × 1
- extension methods × 1
- extra × 1
- facet pattern × 1
- fantomas × 1
- fear × 1
- float × 1
- flowlet × 1
- fp × 1
- frank × 1
- fsdoc × 1
- fsharp.core × 1
- fsharp.powerpack × 1
- fsharpx × 1
- function × 1
- functional style × 1
- games × 1
- gc × 1
- generic × 1
- geometry × 1
- getlastwin32error × 1
- getting started × 1
- google × 1
- group × 1
- hash × 1
- hello world example × 1
- history × 1
- httpcontext × 1
- https × 1
- hubfs × 1
- ie 8 × 1
- if-doc × 1
- iis 8.0 × 1
- inheritance × 1
- installer × 1
- interfaces × 1
- interpreter × 1
- io × 1
- iobservable × 1
- ios × 1
- ipad × 1
- issue × 1
- jqueryui × 1
- kendochart × 1
- kendoui × 1
- learning × 1
- license × 1
- licensing × 1
- macro × 1
- macros × 1
- maps × 1
- markerclusterer × 1
- markup × 1
- marshal × 1
- math × 1
- message × 1
- message passing × 1
- message-passing × 1
- metro style × 1
- micro orm × 1
- minimum-requirements × 1
- module × 1
- multidimensional × 1
- multiline × 1
- multithreading × 1
- mysql × 1
- mysqlclient × 1
- nancy × 1
- native × 1
- nested × 1
- nested loops × 1
- node × 1
- object relation mapper × 1
- object-oriented × 1
- offline × 1
- om × 1
- option × 1
- orm × 1
- osx × 1
- owin × 1
- paper × 1
- parameter × 1
- persistent data structure × 1
- phonegap × 1
- pola × 1
- powerpack × 1
- prefix tree × 1
- principle of least authority × 1
- programming × 1
- projekt_feladat × 1
- protected × 1
- provider × 1
- ptvs × 1
- quant × 1
- quotations × 1
- range × 1
- raphael × 1
- razor × 1
- rc × 1
- reactjs × 1
- real-time × 1
- reference × 1
- remoting × 1
- restful × 1
- round table × 1
- routing × 1
- runtime × 1
- scriptcs × 1
- scripting × 1
- service × 1
- session-state × 1
- sitelet website × 1
- sitlets × 1
- sqlentityconnection × 1
- standards × 1
- stickynotes × 1
- stress × 1
- strong name × 1
- structures × 1
- svg × 1
- tdd × 1
- template × 1
- text parsing × 1
- time travel × 1
- tracing × 1
- tsunamiide × 1
- type inference × 1
- type providers × 1
- typeprovider × 1
- upload × 1
- vb × 1
- vb.net × 1
- vector × 1
- visal studio × 1
- visual f# × 1
- visual studio 11 × 1
- visual studio 2012 × 1
- visual studio shell × 1
- visualstudio × 1
- web api × 1
- webapi × 1
- windows 7 × 1
- windows 8 × 1
- windows-phone × 1
- winrt × 1
- xml × 1
- yield × 1
- zarovizsga × 1
Copyright (c) 2024 IntelliFactory. All rights reserved. | | | Trainings | | | |
Built with |
I really wanted to do it in ASP.NET/F#, but quickly discoverd that they don't support F# (no surprise), and a bit of googling found that no hosts support F# - again no surprise.
So I've written it ASP.NET/C# instead. C# was OK (especially in Visual Studio), but I missed F#. I even prototyped some features in F# (the RSS reader), and rewrote them in C#.
Now, after I've been on it for 2 months, and nearly finished, a moment of illumination has hit me - I don't have to deploy the F# code - I can deploy the DLL's!!! (ie. leave .aspx and aspx.cs files in the root, and deploy F# dll's to Bin)
Bingo! It works!
I don't know whether to laugh or cry - laugh, that I found such a simple solution, or cry, because it took two months!
Anway, I've just discovered the *other* big advantage of working with .Net. The first and obvious advantage is using the .Net libraries, the other advantage is deploying to a language agnostic platform. In 2009, the second advantage is probably the bigger one. (Try deploying OCaml to a host that doesn't have native support!)
Apologies to the .Net gurus who are saying "Well, duh" :)