Litium 8.14 (.net 8) on Mac

Hi, Since Visual studio for mac dose not support .net 8 on Mac, am now tying to switch to VSCode insted after latest release of litium.

The build works just fine, but when trying to run/debug the app the browser just opens breifly to localhost and spits out/downloads an empty file. I can se that backgorund task runs fine, its starts to build elastic documents etc etc, its just the webapp that is having problems.

Any one got the working? If so can you please share the .vscode/launch.json file?

Or have any tips on extra steps needed?

Litium version: 8.14.3

@ton.nguyen are you still using Mac? Any insights?

Yes, here is the file I am using. Give it a try:

{
    "version": "0.2.0",
    "configurations": [
        {
            // Use IntelliSense to find out which attributes exist for C# debugging
            // Use hover for the description of the existing attributes
            // For further information visit https://github.com/dotnet/vscode-csharp/blob/main/debugger-launchjson.md.
            "name": ".NET Core Launch (web)",
            "type": "coreclr",
            "request": "launch",
            "preLaunchTask": "build",
            // If you have changed target frameworks, make sure to update the program path.
            "program": "${workspaceFolder}/Src/Litium.Accelerator.Mvc/bin/Debug/net8.0/Litium.Accelerator.Mvc.dll",
            "args": [],
            "cwd": "${workspaceFolder}/Src/Litium.Accelerator.Mvc",
            "stopAtEntry": false,
            // Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser
            "serverReadyAction": {
                "action": "openExternally",
                "pattern": "\\bNow listening on:\\s+(https?://\\S+)",
                "uriFormat": "https://litium-vnext.localtest.me:%s"
            },
            "env": {
                "ASPNETCORE_ENVIRONMENT": "Development"
            },
            "sourceFileMap": {
                "/Views": "${workspaceFolder}/Views"
            }
        },
        {
            "name": ".NET Core Attach",
            "type": "coreclr",
            "request": "attach"
        }
    ]
}

Thanks, this did not work, No browser opens. When you run with this do you get a custom port number?

Found the port number in the logs, it now runs! thanks!
Its not auto auto opening the browser because the log says:

Now listening on: https://localhost:5001

and not
Now listening on: https://site.localtest.me:5001

How did you set: litium-vnext.localtest.me to be default?

Fixed it for anyone else having the same problem, I altered the pattern to only capture the port from the log:

        "serverReadyAction": {
            "action": "openExternally",
            "pattern": "\\bNow listening on:\\s+https?://\\S+:(\\d+)",
            "uriFormat": "https://nfse.localtest.me:%s"
        },
1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.