Open heartacker opened 2 weeks ago
I just had the same issue. You are using the version 1.7.22 which is the "pre-release" version. Swich to the latest release 1.6.8 from the extension market place, restart vscode and it will fix this issue for you.
Same problem here for "C# Dev Kit" v.1.7.25 (in previous version 1.6 there was no problem.):
vscode ➜ /workspace/LVP/aspnet-core (develop) $ pwd
/workspace/LVP/aspnet-core
vscode ➜ /workspace/LVP/aspnet-core (develop) $ ls -l
total 28
drwxr-xr-x 2 vscode vscode 4096 Dec 15 21:49 build
drwxr-xr-x 3 vscode vscode 4096 Dec 10 2023 docker
-rw-r--r-- 1 vscode vscode 5510 Dec 10 2023 LVP.sln
drwxr-xr-x 2 vscode vscode 4096 Mar 20 12:14 obj
drwxr-xr-x 8 vscode vscode 4096 Jan 10 14:18 src
drwxr-xr-x 5 vscode vscode 4096 Dec 10 2023 test
vscode ➜ /workspace/LVP/aspnet-core (develop) $ ls -l src
total 24
drwxr-xr-x 41 vscode vscode 4096 Jun 13 06:40 LVP.Application
drwxr-xr-x 27 vscode vscode 4096 Apr 29 10:10 LVP.Core
drwxr-xr-x 6 vscode vscode 4096 May 3 12:48 LVP.EntityFrameworkCore
drwxr-xr-x 6 vscode vscode 4096 Dec 10 2023 LVP.Migrator
drwxr-xr-x 10 vscode vscode 4096 Apr 29 10:10 LVP.Web.Core
drwxr-xr-x 12 vscode vscode 4096 Jun 7 12:10 LVP.Web.Host
vscode ➜ /workspace/LVP/aspnet-core (develop) $ dotnet build /workspace/LVP/aspnet-core/LVP.sln /target:LVP_Web_Host /property:GenerateFullPaths=true /consoleloggerparameters:NoSummary /p:Configuration=Debug /p:Platform="Any CPU"
MSBuild version 17.8.3+195e7f5a3 for .NET
Determining projects to restore...
All projects are up-to-date for restore.
/workspace/LVP/aspnet-core/test/LVP.Tester/LVP.Tester.csproj : error MSB4057: The target "LVP_Web_Host" does not exist in the project.
/workspace/LVP/aspnet-core/src/LVP.Application/LVP.Application.csproj : error MSB4057: The target "LVP_Web_Host" does not exist in the project.
/workspace/LVP/aspnet-core/src/LVP.Web.Core/LVP.Web.Core.csproj : error MSB4057: The target "LVP_Web_Host" does not exist in the project.
/workspace/LVP/aspnet-core/test/LVP.Tests/LVP.Tests.csproj : error MSB4057: The target "LVP_Web_Host" does not exist in the project.
/workspace/LVP/aspnet-core/src/LVP.EntityFrameworkCore/LVP.EntityFrameworkCore.csproj : error MSB4057: The target "LVP_Web_Host" does not exist in the project.
/workspace/LVP/aspnet-core/src/LVP.Migrator/LVP.Migrator.csproj : error MSB4057: The target "LVP_Web_Host" does not exist in the project.
/workspace/LVP/aspnet-core/src/LVP.Web.Host/LVP.Web.Host.csproj : error MSB4057: The target "LVP_Web_Host" does not exist in the project.
/workspace/LVP/aspnet-core/src/LVP.Core/LVP.Core.csproj : error MSB4057: The target "LVP_Web_Host" does not exist in the project.
Adding src\\
to /target:
parameter:
vscode ➜ /workspace/LVP/aspnet-core (develop) $ dotnet build /workspace/LVP/aspnet-core/LVP.sln /target:src\\LVP_Web_Host /property:GenerateFullPaths=true /consoleloggerparameters:NoSummary /p:Configuration=Debug /p:Platform="Any CPU"
MSBuild version 17.8.3+195e7f5a3 for .NET
Determining projects to restore...
All projects are up-to-date for restore.
LVP.Core -> /workspace/LVP/aspnet-core/src/LVP.Core/bin/Debug/net8.0/LVP.Core.dll
LVP.Application -> /workspace/LVP/aspnet-core/src/LVP.Application/bin/Debug/net8.0/LVP.Application.dll
LVP.EntityFrameworkCore -> /workspace/LVP/aspnet-core/src/LVP.EntityFrameworkCore/bin/Debug/net8.0/LVP.EntityFrameworkCore.dll
LVP.Web.Core -> /workspace/LVP/aspnet-core/src/LVP.Web.Core/bin/Debug/net8.0/LVP.Web.Core.dll
LVP.Web.Host -> /workspace/LVP/aspnet-core/src/LVP.Web.Host/bin/Debug/net8.0/LVP.Web.Host.dll
vscode ➜ /workspace/LVP/aspnet-core (develop) $
The build generates "/target:LVP_Web_Host" but it should be "/target:src\LVP_Web_Host". "Rebuild" is ok:
* Executing task: dotnet: rebuild /workspace/LVP/aspnet-core/src/LVP.Web.Host/LVP.Web.Host.csproj
dotnet build /workspace/LVP/aspnet-core/LVP.sln /target:src\LVP_Web_Host:rebuild /property:GenerateFullPaths=true /consoleloggerparameters:NoSummary /p:Configuration=Debug /p:Platform="Any CPU"
MSBuild version 17.8.3+195e7f5a3 for .NET
Determining projects to restore...
All projects are up-to-date for restore.
/workspace/LVP/aspnet-core/src/LVP.Core/Identity/SecurityStampValidator.cs(18,13): warning CS0618: 'ISystemClock' is obsolete: 'Use TimeProvider instead.' [/workspace/LVP/aspnet-core/src/LVP.Core/LVP.Core.csproj]
LVP.Core -> /workspace/LVP/aspnet-core/src/LVP.Core/bin/Debug/net8.0/LVP.Core.dll
LVP.Application -> /workspace/LVP/aspnet-core/src/LVP.Application/bin/Debug/net8.0/LVP.Application.dll
LVP.EntityFrameworkCore -> /workspace/LVP/aspnet-core/src/LVP.EntityFrameworkCore/bin/Debug/net8.0/LVP.EntityFrameworkCore.dll
...
LVP.Web.Core -> /workspace/LVP/aspnet-core/src/LVP.Web.Core/bin/Debug/net8.0/LVP.Web.Core.dll
LVP.Web.Host -> /workspace/LVP/aspnet-core/src/LVP.Web.Host/bin/Debug/net8.0/LVP.Web.Host.dll
* Terminal will be reused by tasks, press any key to close it.
It's closed in https://github.com/microsoft/vscode-dotnettools/issues/1200
Describe the Issue
but csproj is ok. and we could start debug that proj individually by vs 2022 or dotnet cli command
Steps To Reproduce
and dotnet cli
``
Expected Behavior
No response
Environment Information
名称: C# Dev Kit ID: ms-dotnettools.csdevkit 说明: Official C# extension from Microsoft 版本: 1.7.22 发布者: Microsoft VS Marketplace 链接: https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csdevkit