WebSharper does need some specific metadata to be present in the assembly where a type used on the client side is defined, even if there is no [<JavaScript>] code in this backend assembly.

All you need to do in this case is to add the WebSharper NuGet reference to your backend project. This will add a post-build pass that runs the WebSharper compiler on this assembly and generates the necessary metadata.

By on 10/17/2014 6:48 AM ()

... but adding websharper nuget package leads to adding several dll's to the backend project, I doubt that all of them are needed. So exacly which dll should I add ?

By on 6/26/2016 8:00 AM ()

ok, a work around for that would be to:

manually edit fsproj file and replace <OutputType>Library</OutputType> with <WebSharperProject>Library</WebSharperProject>

and add `<Import Project="..\..\packages\web\WebSharper\build\WebSharper.targets" Condition="Exists('..\..\packages\web\WebSharper\build\WebSharper.targets')" />`

after `<Import Project="$(FSharpTargetsPath)" Condition="Exists('$(FSharpTargetsPath)')" />`

We need also to reference 3 websharper libs

  1. WebSharper.Core
  2. WebSharper.Core.JavaScript
  3. WebSharper.JavaScript
By on 6/26/2016 9:04 AM ()

Thank you - that worked great.

By on 10/21/2014 1:45 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us
Built with WebSharper