Skip to content
This repository was archived by the owner on Nov 13, 2026. It is now read-only.
This repository was archived by the owner on Nov 13, 2026. It is now read-only.

System.ArgumentNullException while running basic Suave web server #7756

Closed

Description

@lpeixotoo

Hi guys,

I've been trying to come up with a basic web server using Suave + CoreRT. Check this repo for source code and error analysis. When I start the generated executable, it yields the following exception:

Unhandled Exception: System.ArgumentNullException: Value cannot be null. Parameter name: path1
   at System.IO.Path.Combine(String, String) + 0x53
   at Suave.Web.startWebServerAsync(SuaveConfig, FSharpFunc\`2) + 0x46
   at Suave.Web.startWebServer(SuaveConfig, FSharpFunc\`2) + 0x17
   at Program.main(String[]) + 0x28
   at Simple-Web!<BaseAddress>+0x7d639d
Aborted

Activity

  1. MichalStrehovsky commented on Aug 30, 2019

    @MichalStrehovsky
    Member

    It's a bug in Suave: https://github.com/SuaveIO/suave/blob/f3e9ef4147ea9b386afaeb0286d08c8a4ca53896/src/Suave/ParsingAndControl.fs#L125

    Assembly.Location is documented to return an empty string sometime and they don't handle it. They really should use AppContext.BaseDirectory instead.

    Try adding:

    <AppContextSwitchOverrides Include="Switch.System.Reflection.Assembly.SimulatedLocationInBaseDirectory" />
    

    To an itemgroup in your csproj to work around.

  2. MichalStrehovsky commented on Aug 30, 2019

    @MichalStrehovsky
    Member
  3. lpeixotoo commented on Sep 2, 2019

    @lpeixotoo
    Author

    It worked fine @MichalStrehovsky! Thank you! I opened SuaveIO/suave#735 on Suave to track it within CoreRT.

  4. lpeixotoo commented on Sep 18, 2019

    @lpeixotoo
    Author
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions