【问题标题】:Unknown Error: 0x800700c1, While debugging .net Core 3.0 API in VS Code未知错误:0x800700c1,在 VS Code 中调试 .net Core 3.0 API 时
【发布时间】:2020-09-06 06:07:48
【问题描述】:

我正在使用 3.0 构建一个 .Net Core API。

一周前一切正常,几天后,当我尝试调试时,它现在抛出一个奇怪的错误,如左下角的以下屏幕截图所示。

此时调试器停止。

下面是我的 .vscode > launch.jason 文件

{
"version": "0.2.0",
   "configurations": [
        {
            "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/netcoreapp3.0/WebApi.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",
            "processId": "${command:pickProcess}"
        }
    ]
}

以下是我的 WebApi.csproj

<Project Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <TargetFramework>netcoreapp3.0</TargetFramework>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="AutoMapper" Version="9.0.0" />
    <PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="7.0.0" />
    <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.0.0" />
    <PackageReference Include="Microsoft.AspNetCore.Cors" Version="2.2.0" />
    <PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.0.0" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.0.0">
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
      <PrivateAssets>all</PrivateAssets>
    </PackageReference>
    <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="3.0.0" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.0.0" />
    <PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="5.5.0" />
  </ItemGroup>
</Project>

我尝试重新运行项目删除 Debug 文件夹,但没有成功。

【问题讨论】:

  • "program": "${workspaceFolder}/bin/Debug/netcoreapp3.0/WebApi.dll" 那个引用还存在吗?

标签: c# visual-studio-code vscode-debugger .net-core-3.0


【解决方案1】:

有同样的问题。该错误意味着您向调试器发送了一个不是可执行文件的文件。 尝试并验证您尝试调试的可执行文件的路径是否在 launch.json(程序属性)中正确配置。

【讨论】:

  • 这是我的问题。我的launch.json 配置“程序”属性是我的 csproj 文件的路径,当它需要成为我的 DLL 文件的路径时
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-07-24
  • 2018-07-10
  • 1970-01-01
  • 2021-10-05
相关资源
最近更新 更多