You have two fundamental choices to run that particular example - because it's a sitelet (note the change of Visual Studio template names since the latest 2.5.128 version - which was just released the other day):

  • As an "HTML Application" (also referred to as an "offline sitelet" in various places in the documentation): this will generate HTML+JS code from a sitelet upon build into bin/html. You can serve this folder from pretty much any web container. To do so, you need to configure your deployment and copy the contents of bin/html into it. Note that these applications are fully HTML+JS, with no server side.
  • As a "Client-Server Application" (also referred to as an "online sitelet"): this will need an application container like IIS, and you can access the "current time" page at /index, unless you changed that binding in the code.

The other main template choice, "Single-Page Application" is not applicable here, as it's not for sitelets. See the Visual Studio templates tab on the Learn page for a bit more information.

Also, there is an updated page in the documentation on How to run examples from the WebSharper site, detailing the four basic scenarios (Single-Page Application, HTML Application, Client-Server Application, and via ASPX markup) and how to adapt the template code accordingly.

Hope this helps.

By on 10/11/2014 1:38 PM ()

Thanks for your suggestion.

I will take your advice and use one of the other templates.

I was just a bit curious why executing IIS Express on the command line successfully processes //localhost:64986/ in the browser. Though clicking the Start button in IIS 8.0 and then entering //localhost:64986/ fails because it is looking for a default document. Instead of somehow passing the request to one of the Websharper DLLs or my Website5.DLL. Which is what I presume IIS Express does. Maybe in IIS 8.0 additional setup steps are required in the Modules or Handler Mapping sections.

C:\Program Files (x86)\IIS Express>iisexpress /site:WebSite5

Starting IIS Express ...
Successfully registered URL "[link:localhost:64986] for site "Website5" application "/"
Registration completed for site "Website5"
IIS Express is running.
Enter 'Q' to stop IIS Express

Request started: "GET" [link:localhost:64986]
Request ended: [link:localhost:64986] with HTTP status 200.0
Request ended: [link:localhost:64986] with HTTP status 200.0
Request started: "GET" [link:localhost:64986]
Request ended: [link:localhost:64986] with HTTP status 404.0

By on 10/13/2014 11:01 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper