Skip to content

Not able to start web server in MAC OS (Sonoma 14.5) #601

@Madhukumars

Description

@Madhukumars

I have a MAUI app where I'm trying to load a web application in WebView control. I need a web server on a particular path to serve the files which are part of index.html. I am using Embed.IO package to create a web server since it's cross-platform, but I'm facing a "Platform Not supported" exception in MAC. (It works fine in Windows).

Here is how I'm starting the web server

    private WebServer _server;
    public void StartLocalServer(string url, string webAppPath)
    {
        try
        {                            
            _server = new WebServer(x => x
            .WithUrlPrefix(url) 
            .WithMode(HttpListenerMode.EmbedIO))
            .WithStaticFolder("/", webAppPath, true); // Serve files from the webAppPath

            // Run the server
            _server.RunAsync();                
        }
        catch (Exception ex)
        {                
        }
    }

The exception I get in MAC OS is

Image

The MAC OS is Sonoma 14.5 and chip is Apple M1 Pro.

Any help in solving this is appreciated.

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