繁体   English   中英

该程序已退出,Visual Studio Code + Asp.net 核心应用程序中的代码为 -532462766

[英]The program has exited with code -532462766 in Visual Studio Code + Asp.net core app

我不知道在哪里寻找这个原因:

我有 asp.net 核心应用程序 (.net6) 当我尝试在 Visual Studio 2022 中以调试模式启动应用程序时 - 它运行良好。 当我尝试在 VS Code 中以调试模式启动我的应用程序时,我看到以下内容:

使用来自 '...\TelegramBot\Properties\launchSettings.json' [Profile 'TelegramBot'] 的启动设置...加载 'C:\Program Files\do.net\shared\Microsoft.NETCore.App\6.0.8\ System.Private.CoreLib.dll'。 跳过加载符号。 模块已优化,调试器选项“仅我的代码”已启用。 程序“[6592] TelegramBot.dll”已退出,代码为 -532462766 (0xe0434352)。

我的 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"
        }
    ]
}

任务的一部分.json

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

非常感谢所有提供帮助的人!

在 .csprog 文件中将属性更改为 x64 将解决此问题。 都是因为我试图通过 x64 启动 x86 项目 sdk

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM