Coming from 2.5
A few months ago, I installed Websharper 2.5.128.65. If you install Websharper today, you will download version 3.0.15.92-alpha. Unfortunately this contains breaking changes for your old code if you wrote any. Even some examples on Websharper’s website break because of the new version.
The markup types, like “Div” “Table” are not in the namespace “IntelliFactory.WebSharper.Html” anymore, these are now in the namespace “IntelliFactory.WebSharper.Html.Client”. Changing the namespace should do the trick.
Javascript logging was first done with a line like this:
This usually applies for new projects. If you run a Websharper client, you may see a “Server Error” complaining that the Fsharp.Core cannot be found, and mentioning something like this:
In the Web.config, you will find this section:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.3.1.0" newVersion="4.3.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
Cannot Add new Item
This one got me worried about the stability of my work-laptop. At some point it is possible that when you want to add a new item, for example, a new .fs file, to you websharper project, that the window listing the code templates is empty. You can still add new items to purely F# projects, or C# projects, so this only happens for Websharper projects.
I am not sure how this situation occurs, but you will need to run this script to get your templates back again: script to recover templates
Also, this script is supplied in a Websharper project when you create a new project, under the name “Setup.fsx”.
Run this script as follows: open Setup.fsx, select all, click with right-mouse on the selected text and run it in the F# Interactive. After this operation, you should have your templates back again.
Remoting examples
Did you want to try one of the Websharper examples with remoting and got an HTTP 405? Then you probably took a “Single Page Application” and extended it with [<Rpc>] or [<Remote>] attributes to do something server side.
The problem is: there is no server. If you want to do anything on the server, then you require a Client Server Application. Halfway down the following page you find instructions how to run the remoting examples: Instruction remoting examples