Links: Back F# Home F# Library
For F# to work correctly with ASP.NET the CodeDOM provider needs to be configured in the web.config
file.
web.config
file (e.g. Version=1.9.3.0) matches your installed F# version number.
Example web.config
file:
<?xml version="1.0"?> <configuration> <system.web> <compilation debug="true"> <assemblies> <add assembly="FSharp.Compiler.CodeDom, Version=1.9.3.0, Culture=neutral,PublicKeyToken=a19089b1c74d0809"/> </assemblies> <compilers> <compiler language="F#;f#;fs;fsharp" extension=".fs" type="Microsoft.FSharp.Compiler.CodeDom.FSharpAspNetCodeProvider"/> </compilers> </compilation> </system.web> </configuration>
This should be enough to develop F# ASP.NET using Visual Studio.
Note, for IIS it is necessary to have the ASP.net 2.0 extensions registered (if a website is configured to use ASP.net 2.0 without it being registered you may get 404 errors). If ASP.net 2.0 doesn't appear under "Web Service Extensions" in the IIS control panel, it can be registered using the following command:
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -iru -enable
See Installing and Configuring ASP.NET for more information.