VS Code - 更改为.csproj,无法再调试

时间:2017-04-04 23:39:32

标签: .net visual-studio-code vscode-settings

我最近将project.json文件更改为.csproj文件。

我尝试启动调试实例,但它返回错误:

Microsoft (R) Build Engine version 15.1.548.43366
Copyright (C) Microsoft Corporation. All rights reserved.
MSBUILD : error MSB1009: Project file does not exist.
Switch: /Users/my_user/sf-build-ms-port/sfbuild-DotNetCore/project.json

并出现错误消息:

The preLaunchTask 'build' terminated with exit code 1.

出现在顶部。

这是我的.csproj文件:

<Project Sdk="Microsoft.NET.Sdk">
    <PropertyGroup>
        <TargetFramework>netcoreapp1.1</TargetFramework>
        <DebugType>portable</DebugType>
        <AssemblyName>sfbuild</AssemblyName>
        <OutputType>Exe</OutputType>
        <PackageId>sfbuild-DotNetCore</PackageId>
<PackageTargetFallback>$(PackageTargetFallback);dnxcore50</PackageTargetFallback>
<RuntimeFrameworkVersion>1.1.1</RuntimeFrameworkVersion>
</PropertyGroup>

  <ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.1' ">
    <PackageReference Include="System.Xml.XmlDocument" Version="4.3.0" />
    <PackageReference Include="System.Xml.XDocument" Version="4.3.0" />
    <PackageReference Include="System.Runtime.InteropServices" Version="4.3.0" />
     <PackageReference Include="System.Diagnostics.Process" Version="4.3.0" />
   </ItemGroup>

</Project>

我的调试设置是:

{
"version": "0.2.0",
"configurations": [
    {
        "name": ".NET Core Launch (console)",
        "type": "coreclr",
        "request": "launch",
        "preLaunchTask": "build",
        "program": "${workspaceRoot}/bin/Debug/netcoreapp1.1/sfbuild.dll",
        "args": [],
        "cwd": "${workspaceRoot}",
        "externalConsole": false,
        "stopAtEntry": false,
        "internalConsoleOptions": "openOnSessionStart"
    },
    {
        "name": ".NET Core Attach",
        "type": "coreclr",
        "request": "attach",
        "processId": "${command.pickProcess}"
    }
]
}

我知道该计划绝对是正确的道路。

0 个答案:

没有答案