You have to pass -r DeserializationIssue.dll to the WebSharper compiler as Json.Deserialize<_> is implemented by a macro so the WS compiler needs a reference to the dll the concrete type is in.

By on 11/20/2015 6:46 AM ()

There seem to be something different between the MSBuild + WebSharper Target and WebSharper.exe when using Json. It compiles and bundle fine using the MSBuild on VS but when using WebSharper.exe, it just refuses to compile to WebSharper prompting the same error.

By on 11/22/2015 4:26 PM ()

Hi Istvan thanks for the reply, I just tried to reference the dll but it still yield the same result.

1
WebSharper.exe -r "C:\Projects\DeserializationIssue\packages\WebSharper\lib\net40\WebSharper.Collections.dll" -r "C:\Projects\DeserializationIssue\packages\WebSharper\lib\net40\WebSharper.Control.dll" -r "C:\Projects\DeserializationIssue\packages\WebSharper\lib\net40\WebSharper.Core.dll" -r "C:\Projects\DeserializationIssue\packages\WebSharper\lib\net40\WebSharper.Core.JavaScript.dll" -r "C:\Projects\DeserializationIssue\packages\WebSharper\lib\net40\WebSharper.InterfaceGenerator.dll" -r "C:\Projects\DeserializationIssue\packages\WebSharper\lib\net40\WebSharper.JavaScript.dll" -r "C:\Projects\DeserializationIssue\packages\WebSharper\lib\net40\WebSharper.JQuery.dll" -r "C:\Projects\DeserializationIssue\packages\WebSharper\lib\net40\WebSharper.Main.dll" -r "C:\Projects\DeserializationIssue\packages\WebSharper\lib\net40\WebSharper.Sitelets.dll" -r "C:\Projects\DeserializationIssue\packages\WebSharper.UI.Next\lib\net40\WebSharper.UI.Next.dll" -r "C:\Projects\DeserializationIssue\packages\WebSharper.UI.Next\lib\net40\WebSharper.UI.Next.Templating.dll" -r "C:\Projects\DeserializationIssue\packages\WebSharper\lib\net40\WebSharper.Web.dll" -r DeserializationIssue.dll DeserializationIssue.dll Compiled_DeserializationIssue.dll
By on 11/20/2015 7:03 AM ()

I've also tried to separate the User type in another fs file and compile it on its own (in a dll called domain). So I had 2 dlls: Domain.dll and Client.dll, even with a ref -r Domain.dll, I can't compile the Client it still yield:

1
System.Exception: DeserializationIssue.Domain+User: Deserialize: Type not supported: DeserializationIssue.Domain+User
By on 11/20/2015 2:16 PM ()
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