dotnet-websharper / core

WebSharper - Full-stack, functional, reactive web apps and microservices in F# and C#
https://websharper.com
Apache License 2.0
599 stars 50 forks source link

Error in InlineControl #500

Open runefs opened 9 years ago

runefs commented 9 years ago

I have a web site that worked prior to updating to mono 4.2. I no get the following. Abbriviated stack trace

System.AggregateException: One or more errors occurred. ---> System.Exception: Error in InlineControl at C:\Users\hudson.IFBUDS02\Server\var\jobs\websharper.ui.next\workspace\WebSharper.UI.Next\Doc.fs: 459.58-459.79: Couldn't find address for method
at <StartupCode$WebSharper-Web>.$Control+WebSharper-IRequiresResources-Encode@144.Invoke (System.String message) [0x00001] in <filename unknown>:0 
at Microsoft.FSharp.Core.PrintfImpl+StringPrintfEnv`1[TResult].Finalize () [0x00012] in <filename unknown>:0 
at Microsoft.FSharp.Core.PrintfImpl+Final1@224[TState,TResidue,TResult,A].Invoke (Microsoft.FSharp.Core.FSharpFunc`2 env, A a) [0x00038] in <filename unknown>:0 
at Microsoft.FSharp.Core.OptimizedClosures+Invoke@3252[T2,TResult,T1].Invoke (T2 u) [0x00001] in <filename unknown>:0 
at WebSharper.Web.InlineControl`1[T].WebSharper-IRequiresResources-Encode (WebSharper.Core.Info meta, WebSharper.Core.Provider json) [0x00071] in <filename unknown>:0 
at WebSharper.UI.Next.ConcreteDoc.Encode (WebSharper.Core.Info meta, WebSharper.Core.Provider json) [0x00053] in <filename unknown>:0 
at WebSharper.UI.Next.Doc.WebSharper-IRequiresResources-Encode (WebSharper.Core.Info meta, WebSharper.Core.Provider json) [0x00000] in <filename unknown>:0 
at <StartupCode$WebSharper-UI-Next>.$Doc+Encode@151-1.Invoke (WebSharper.UI.Next.Doc e) [0x00000] in <filename unknown>:0 

I have the following references and are compiling with xbuild in Xamarin Studio. If I compile with MSBuild I get an error saying "Unknown MSBuild error try compiling again"

<ItemGroup>
  <Reference Include="mscorlib" />
  <Reference Include="System" />
  <Reference Include="System.Core" />
  <Reference Include="System.Numerics" />
  <Reference Include="System.Web" />
  <Reference Include="Mono.Cecil">
  <Private>True</Private>
  </Reference>
  <Reference Include="System.Xml" />
  <Reference Include="System.Xml.Linq" />
  <Reference Include="System.Configuration" />
  <Reference Include="FSharp.Data">
    <HintPath>..\packages\FSharp.Data.2.2.5\lib\net40\FSharp.Data.dll</HintPath>
  </Reference>
  <Reference Include="IntelliFactory.Xml">
    <HintPath>..\packages\IntelliFactory.Xml.0.6.63.95\lib\net40\IntelliFactory.Xml.dll</HintPath>
  </Reference>
  <Reference Include="Owin">
    <HintPath>..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath>
  </Reference>
  <Reference Include="Microsoft.Owin">
    <HintPath>..\packages\Microsoft.Owin.3.0.1\lib\net45\Microsoft.Owin.dll</HintPath>
  </Reference>
  <Reference Include="Microsoft.Owin.Hosting">
    <HintPath>..\packages\Microsoft.Owin.Hosting.3.0.1\lib\net45\Microsoft.Owin.Hosting.dll</HintPath>
  </Reference>
  <Reference Include="Microsoft.Owin.Host.HttpListener">

   <HintPath>..\packages\Microsoft.Owin.Host.HttpListener.3.0.1\lib\net45\Microsoft.Owin.Host.HttpListener.dll</HintPath>
  </Reference>
  <Reference Include="Microsoft.Owin.Diagnostics">
    <HintPath>..\packages\Microsoft.Owin.Diagnostics.3.0.1\lib\net45\Microsoft.Owin.Diagnostics.dll</HintPath>
  </Reference>
  <Reference Include="Microsoft.Owin.FileSystems">
    <HintPath>..\packages\Microsoft.Owin.FileSystems.3.0.1\lib\net45\Microsoft.Owin.FileSystems.dll</HintPath>
  </Reference>
  <Reference Include="Microsoft.Owin.StaticFiles">
    <HintPath>..\packages\Microsoft.Owin.StaticFiles.3.0.1\lib\net45\Microsoft.Owin.StaticFiles.dll</HintPath>
  </Reference>
  <Reference Include="RegexProvider">
    <HintPath>..\packages\RegexProvider.0.0.5\lib\net40\RegexProvider.dll</HintPath>
  </Reference>
  <Reference Include="System.Drawing" />
  <Reference Include="FSharp.Compiler.Service">
    <HintPath>..\packages\FSharp.Compiler.Service.1.4.0.6\lib\net45\FSharp.Compiler.Service.dll</HintPath>
  </Reference>
  <Reference Include="FSharpVSPowerTools.Core">
    <HintPath>..\packages\FSharpVSPowerTools.Core.2.1.0\lib\net45\FSharpVSPowerTools.Core.dll</HintPath>
  </Reference>
  <Reference Include="CSharpFormat">
    <HintPath>..\packages\FSharp.Formatting.2.12.0\lib\net40\CSharpFormat.dll</HintPath>
  </Reference>
  <Reference Include="FSharp.CodeFormat">
    <HintPath>..\packages\FSharp.Formatting.2.12.0\lib\net40\FSharp.CodeFormat.dll</HintPath>
  </Reference>
  <Reference Include="FSharp.Literate">
    <HintPath>..\packages\FSharp.Formatting.2.12.0\lib\net40\FSharp.Literate.dll</HintPath>
  </Reference>
  <Reference Include="FSharp.Markdown">
    <HintPath>..\packages\FSharp.Formatting.2.12.0\lib\net40\FSharp.Markdown.dll</HintPath>
  </Reference>
  <Reference Include="FSharp.Formatting.Common">
    <HintPath>..\packages\FSharp.Formatting.2.12.0\lib\net40\FSharp.Formatting.Common.dll</HintPath>
  </Reference>
  <Reference Include="FSharp.MetadataFormat">
    <HintPath>..\packages\FSharp.Formatting.2.12.0\lib\net40\FSharp.MetadataFormat.dll</HintPath>
  </Reference>
  <Reference Include="RazorEngine">
    <HintPath>..\packages\FSharp.Formatting.2.12.0\lib\net40\RazorEngine.dll</HintPath>
  </Reference>
  <Reference Include="System.Web.Razor">
    <HintPath>..\packages\FSharp.Formatting.2.12.0\lib\net40\System.Web.Razor.dll</HintPath>
  </Reference>
  <Reference Include="WebSharper.Core.JavaScript">
    <HintPath>..\packages\WebSharper.3.6.2.220\lib\net40\WebSharper.Core.JavaScript.dll</HintPath>
  </Reference>
  <Reference Include="WebSharper.Core">
    <HintPath>..\packages\WebSharper.3.6.2.220\lib\net40\WebSharper.Core.dll</HintPath>
  </Reference>
  <Reference Include="WebSharper.InterfaceGenerator">
    <HintPath>..\packages\WebSharper.3.6.2.220\lib\net40\WebSharper.InterfaceGenerator.dll</HintPath>
  </Reference>
  <Reference Include="WebSharper.Sitelets">
    <HintPath>..\packages\WebSharper.3.6.2.220\lib\net40\WebSharper.Sitelets.dll</HintPath>
  </Reference>
  <Reference Include="WebSharper.Web">
    <HintPath>..\packages\WebSharper.3.6.2.220\lib\net40\WebSharper.Web.dll</HintPath>
  </Reference>
  <Reference Include="WebSharper.Main">
    <HintPath>..\packages\WebSharper.3.6.2.220\lib\net40\WebSharper.Main.dll</HintPath>
  </Reference>
  <Reference Include="WebSharper.Collections">
    <HintPath>..\packages\WebSharper.3.6.2.220\lib\net40\WebSharper.Collections.dll</HintPath>
  </Reference>
  <Reference Include="WebSharper.Control">
    <HintPath>..\packages\WebSharper.3.6.2.220\lib\net40\WebSharper.Control.dll</HintPath>
  </Reference>
  <Reference Include="WebSharper.JavaScript">
    <HintPath>..\packages\WebSharper.3.6.2.220\lib\net40\WebSharper.JavaScript.dll</HintPath>
  </Reference>
  <Reference Include="WebSharper.JQuery">
    <HintPath>..\packages\WebSharper.3.6.2.220\lib\net40\WebSharper.JQuery.dll</HintPath>
  </Reference>
  <Reference Include="WebSharper.UI.Next">
    <HintPath>..\packages\WebSharper.UI.Next.3.6.2.196\lib\net40\WebSharper.UI.Next.dll</HintPath>
  </Reference>
  <Reference Include="WebSharper.UI.Next.Templating">
    <HintPath>..\packages\WebSharper.UI.Next.3.6.2.196\lib\net40\WebSharper.UI.Next.Templating.dll</HintPath>
  </Reference>
  <Reference Include="WebSharper.Owin">
    <HintPath>..\packages\WebSharper.Owin.3.6.1.115\lib\net45\WebSharper.Owin.dll</HintPath>
  </Reference>
  <Reference Include="HttpMultipartParser">
    <HintPath>..\packages\WebSharper.Owin.3.6.1.115\lib\net45\HttpMultipartParser.dll</HintPath>
  </Reference>
  <Reference Include="WebSharper.Html.Client">
    <HintPath>..\packages\WebSharper.Html.3.6.2.12\lib\net40\WebSharper.Html.Client.dll</HintPath>
  </Reference>
  <Reference Include="WebSharper.Html.Server">
    <HintPath>..\packages\WebSharper.Html.3.6.2.12\lib\net40\WebSharper.Html.Server.dll</HintPath>
  </Reference>
  <Reference Include="WebSharper.D3">
    <HintPath>..\packages\WebSharper.D3.3.6.2.101\lib\net40\WebSharper.D3.dll</HintPath>
  </Reference>
</ItemGroup>
granicz commented 9 years ago

Can you post your client <@ ... @> instances? I mean the inside of those expressions. This error means that either one of those instances (we should improve error reporting here and print what expressions failed...) don't conform to the expected form, or that "something else" broke. Seeing your client expressions would greatly help, thanks!

granicz commented 9 years ago

Ah, sorry, accidentally closed issue, reopening.

runefs commented 9 years ago

Of course client <@ Metrics.Main("trello") @>

I've reduced the above function to

let Main teamName = 
      Doc.Empty

and it still fails

I also tried reducing the function to simply

 let f() = Doc.Empty

in the main module which fails however if I reduce it further to

[client <@ Doc.Empty @>]

it doesn't fail any more substituting Doc.Empty with text "" or similar also works