1

I can't figure out where to look for the reason of this:

I have asp.net core app (.net6) When I try to launch app in Debug mode in Visual Studio 2022 - it's works well. When I try to launch my app in debug mode in VS Code, I see follows:

Using launch settings from '...\TelegramBot\Properties\launchSettings.json' [Profile 'TelegramBot']... Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.8\System.Private.CoreLib.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. The program '[6592] TelegramBot.dll' has exited with code -532462766 (0xe0434352).

my launch.json

{
    "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/OmniSharp/omnisharp-vscode/blob/master/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}/bin/Debug/net6.0/TelegramBot.dll",
            "args": [],
            "cwd": "${workspaceFolder}",
            "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+)"
            },
            "env": {
                "ASPNETCORE_ENVIRONMENT": "Development"
            },
            "sourceFileMap": {
                "/Views": "${workspaceFolder}/Views"
            }
        },
        {
            "name": ".NET Core Attach",
            "type": "coreclr",
            "request": "attach"
        }
    ]
}

part of tasks.json

{
            "label": "build",
            "command": "dotnet",
            "type": "process",
            "args": [
                "build",
                "${workspaceFolder}/TelegramBot.csproj",
                "/property:GenerateFullPaths=true",
                "/consoleloggerparameters:NoSummary"
            ],
            "problemMatcher": "$msCompile"
        }

Many thanks to everyone who helps!

Adriaan
  • 17,741
  • 7
  • 42
  • 75
Vlad
  • 11
  • 5
  • strip the source code until you get no errors and then gradually add – rioV8 Sep 08 '22 at 09:04
  • Try to create a new sample project by dotnet-cli, then test again. – Jason Pan Sep 08 '22 at 09:58
  • Debugging new project works good! – Vlad Sep 08 '22 at 18:12
  • Pls try to [set "justMyCode"= false](https://stackoverflow.com/questions/52980448/how-to-disable-just-my-code-setting-in-vscode-debugger/57831657#57831657). – Jason Pan Sep 12 '22 at 09:33
  • 1
    Found reason later on this day. All because of I tried to launch x86 project over x64 sdk – Vlad Sep 14 '22 at 09:51
  • Could you share more details about how launch x86 project ? From the error msg, we can't find out the reason. And your answer will help others who face the same issue. – Jason Pan Sep 15 '22 at 09:51
  • 1
    @JasonPan I meant to just change PlatformTarget property to x64 in .csprog file. – Vlad Sep 16 '22 at 20:08
  • Please do not add answers to the question body itself. Instead, you should add it as an answer. [Answering your own question is allowed and even encouraged](https://stackoverflow.com/help/self-answer). – Adriaan Feb 02 '23 at 10:03

1 Answers1

0

Changing property to x64 in .csprog file will resolve this problem. All because of I tried to launch x86 project over x64 sdk

Vlad
  • 11
  • 5