0

I'm testing out ASP.NET Core using this tutorial: https://www.blinkingcaret.com/2018/03/20/net-core-linux/

When building and running from the terminal, both the CLI and Web app works fine:

Web app:

dotnet run
Using launch settings from /home/peter/Documents/dotnet_linux/Reminders.Web/Properties/launchSettings.json...
info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0]
    User profile is available. Using '/home/peter/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest.
Hosting environment: Development
Content root path: /home/peter/Documents/dotnet_linux/Reminders.Web
Now listening on: https://localhost:5001
Now listening on: http://localhost:5000
Application started. Press Ctrl+C to shut down.

However from VS Code 1.28.1 I can only run the CLI app. When I add a configuration for the web app:

{
    // 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/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
    "version": "0.2.0",
    "configurations": [
        {
            "name": ".NET Core Launch (web)",
            "type": "coreclr",
            "request": "launch",
            "preLaunchTask": "build",
            "program": "${workspaceFolder}/Reminders.Web/bin/Debug/netcoreapp2.1/Reminders.Web.dll>",
            "args": [],
            "cwd": "${workspaceFolder}/Reminders.Web/bin/Debug",
            "stopAtEntry": false,
            "launchBrowser": {
                "enabled": true,
                "args": "${auto-detect-url}",
                "windows": {
                    "command": "cmd.exe",
                    "args": "/C start ${auto-detect-url}"
                },
                "osx": {
                    "command": "open"
                },
                "linux": {
                    "command": "xdg-open"
                }
            },
            "env": {
                "ASPNETCORE_ENVIRONMENT": "Development"
            },
            "sourceFileMap": {
                "/Views": "${workspaceFolder}/Views"
            }
        },
        {
            "name": ".NET Core Launch (console)",
            "type": "coreclr",
            "request": "launch",
            "preLaunchTask": "build",
            // If you have changed target frameworks, make sure to update the program path.
            "program": "${workspaceFolder}/Reminders.Cli/bin/Debug/netcoreapp2.1/Reminders.Cli.dll",
            "args": [],
            "cwd": "${workspaceFolder}/Reminders.Cli",
            // For more information about the 'console' field, see https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#console-terminal-window
            "console": "internalConsole",
            "stopAtEntry": false,
            "internalConsoleOptions": "openOnSessionStart"
        },
        {
            "name": ".NET Core Attach",
            "type": "coreclr",
            "request": "attach",
            "processId": "${command:pickProcess}"
        },
    ]
}

I get the error

enter image description here

This DLL does indeed exist.

I have looked through all config options for launch.json here: https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md but not found anything

5
  • 1
    You really have that extra angle bracket at the end of the file on your file system? Somehow I doubt it, looks like you snuck a typo into your config file. Commented Oct 16, 2018 at 19:51
  • I dont think so, but which bracket are you referring to? VS Code doesnt complain, and since I can run the CLI project from within VSCode I dont think there is a major problem with it. Commented Oct 16, 2018 at 20:09
  • Look at the error message. Do you see the path in quotes? Do you see how it has an angle bracket at the end of it? > That is part of the path, and it's highly unlikely you have a file named Reminders.Web.dll> on your file system. Commented Oct 16, 2018 at 20:16
  • 100% correct sir! Damn how could I miss that.... And not a single warning from VSCode about it..... runs perfect now! Put in an answer so I can accept it. Commented Oct 16, 2018 at 20:18
  • VS Code isn't magic. It's not going to be able to check everything. And when it does check, and tell you the file doesn't exist....well that's kinda on you to handle from there! Commented Oct 16, 2018 at 20:22

1 Answer 1

1

You have an extra angle bracket.

Change

"program": "${workspaceFolder}/Reminders.Web/bin/Debug/netcoreapp2.1/Reminders.Web.dll>",

to

 "program": "${workspaceFolder}/Reminders.Web/bin/Debug/netcoreapp2.1/Reminders.Web.dll",
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.