Giter VIP home page Giter VIP logo

Comments (7)

intellifactory-bb avatar intellifactory-bb commented on July 19, 2024

Looks like {{{System.Uri}}} handling in Mono is inconsistent with .NET. I attempted to work around this, which made your particular program run. There might be more issues, please report if you encounter any. Thanks.


Original comment by: Anton Tayanovskyy

from core.

intellifactory-bb avatar intellifactory-bb commented on July 19, 2024

Fix #13.

→ <<cset 047e284b6218>>


Original comment by: Anton Tayanovskyy

from core.

intellifactory-bb avatar intellifactory-bb commented on July 19, 2024

Just ran into the same issue using XSP4 rather than Apache


Original comment by: perfectshuffle

from core.

intellifactory-bb avatar intellifactory-bb commented on July 19, 2024

Fixed with 1 line change. See patch below:

#!diff

# HG changeset patch
# User James Freiwirth
# Date 1370820182 -3600

Fix URL generation for Ctx.Link on MONO
See also: https://bitbucket.org/IntelliFactory/websharper/issue/13/url-resolving-functions-misbehaving-on

diff --git a/IntelliFactory.WebSharper.Sitelets/Router.fs b/IntelliFactory.WebSharper.Sitelets/Router.fs
--- a/IntelliFactory.WebSharper.Sitelets/Router.fs
+++ b/IntelliFactory.WebSharper.Sitelets/Router.fs
@@ -47,7 +47,7 @@

     /// Creates an absolute or relative URI from a string.
     let makeUri uri =
-        Uri(uri, UriKind.RelativeOrAbsolute)
+        Uri(uri, UriKind.Relative)

     let isAbsoluteUri uri =
         (makeUri uri).IsAbsoluteUri


Original comment by: perfectshuffle

from core.

intellifactory-bb avatar intellifactory-bb commented on July 19, 2024

Sorry for the awful delay, I am just hitting this same issue again with Mono 3.2.3 and WebSharper 2.5 alpha. Your fix seems to work, as does the following (I know, absolute URIs may not be very likely but still)..

let makeUri str =
  let mutable res = null
  if System.Uri.TryCreate(str, System.UriKind.Relative, &res) then res else
    System.Uri(str, System.UriKind.Absolute)

The TryCreate methods may only work with latest frameworks (such as .NET 4x) but this is what we are targeting anyway for WebSharper 2.5. Will commit soon.


Original comment by: Anton Tayanovskyy

from core.

intellifactory-bb avatar intellifactory-bb commented on July 19, 2024

Fix #13; Fix #161; Fix #162

→ <<cset 8fdd3e14601d>>


Original comment by: Anton Tayanovskyy

from core.

intellifactory-bb avatar intellifactory-bb commented on July 19, 2024

Looks like System.Uri handling in Mono is inconsistent with .NET.

Did you report the bug in Xamarin's bugzilla?


Original comment by: knocte

from core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.