Search code examples
htmlvisual-studio-2012msbuildf#websharper

Display HTML page using Websharper without Visual Studio


I'm doing a simple demo that involves creating an HTML page using F# and Websharper. Using the samples from the Websharper website I'm able to run a simple Hello World page using sitelets when I hit Debug on Visual Studio. I'm wondering if there's a way to package this in such a way that I don't have to open the file in Visual Studio and hit debug to display the content? I've tried using msbuild from the command line to build the solution but I've had no luck opening the browser that way. What I need is a way to compile the code and display the HTML page without having to open up VS. Also I'm using Web Applications (Sitelets) template for VS for Web Express 2012. Thanks


Solution

  • The "Web Applications (Sitelets)" template does not actually generate HTML files, it generates a DLL that can be run by an ASP.NET runtime. Therefore, depending on your situation:

    • If you simply want to generate HTML files, without any server-side computation, then you should use the HTML Application template instead. It compiles the sitelet into a set of .html files.

    • If you need a server runtime, your safest bet is to install ASP.NET for IIS. You can find it in "Turn Windows features on or off", somewhere in the control panel. Then, in IIS Manager, add a Website and point it to the Web folder of your application.