-
Notifications
You must be signed in to change notification settings - Fork 652
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The terminal shell path "dotnet" is a directory #3350
Comments
Hi @abaga129, |
It's not exactly fixed. I have to change my tasks to have a hardcoded path to the dotnet binary e.g. Thanks for your time |
I agree, this is not fixed and should not be closed! Every time I create a project, I have to go in and hardcode the path to the dotnet executable. |
Further, if I use F5 to build the project, I get this error message, but if I open a terminal and use |
The true error is that the |
Thanks @auspex! That did the trick for me as well! I guess now this issue can be closed sarcasm |
Just wanted to mention that in my case changing |
Just to update, this issue was fixed properly in microsoft/vscode#158666 and the fix should be available in the next vscode release. |
Issue Description
Cant run "build" task because "The preLaunchTask 'build' terminated with exit code -2."
I've narrowed it down to the following
The terminal shell path "dotnet" is a directory
. Changing the build task to have a direct path to thedotnet
executable works.Before (Error)
After (Works)
Steps to Reproduce
Install dotnet sdk 3.0 on linux using dotnet-install.sh script.
Add path to .bashrc or .zshrc
Run build task in vscode (ctrl + shift + B)
Expected Behavior
The project will build correctly
Actual Behavior
Logs
OmniSharp log
OmniSharp server started with Mono 6.0.0.
Path: /home/ethanpreker/.vscode/extensions/ms-vscode.csharp-1.21.4/.omnisharp/1.34.4/omnisharp/OmniSharp.exe
PID: 6056
Starting OmniSharp on manjaro 0.0 (x64)
info: OmniSharp.Services.DotNetCliService
DotNetPath set to dotnet
[warn]: OmniSharp.MSBuild.Discovery.Providers.MonoInstanceProvider
It looks like you have Mono 5.2.0 or greater installed but MSBuild could not be found.
Try installing MSBuild into Mono (e.g. 'sudo apt-get install msbuild') to enable better MSBuild support.
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 1 MSBuild instance(s)
1: StandAlone 16.0 - "/home/ethanpreker/.vscode/extensions/ms-vscode.csharp-1.21.4/.omnisharp/1.34.4/omnisharp/.msbuild/Current/Bin"
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
MSBUILD_EXE_PATH environment variable set to '/home/ethanpreker/.vscode/extensions/ms-vscode.csharp-1.21.4/.omnisharp/1.34.4/omnisharp/.msbuild/Current/Bin/MSBuild.dll'
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: StandAlone 16.0 - "/home/ethanpreker/.vscode/extensions/ms-vscode.csharp-1.21.4/.omnisharp/1.34.4/omnisharp/.msbuild/Current/Bin"
CscToolExe = csc.exe
TargetFrameworkRootPath = /usr/lib/mono/xbuild-frameworks
MSBuildToolsPath = /home/ethanpreker/.vscode/extensions/ms-vscode.csharp-1.21.4/.omnisharp/1.34.4/omnisharp/.msbuild/Current/Bin
CscToolPath = /home/ethanpreker/.vscode/extensions/ms-vscode.csharp-1.21.4/.omnisharp/1.34.4/omnisharp/.msbuild/Current/Bin/Roslyn
BypassFrameworkInstallChecks = true
MSBuildExtensionsPath = /usr/lib/mono/xbuild
info: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in '/home/ethanpreker/Repos/ProcessedSaleWatcherService'.
info: OmniSharp.Cake.CakeProjectSystem
Could not find any Cake files
info: OmniSharp.MSBuild.ProjectSystem
No solution files found in '/home/ethanpreker/Repos/ProcessedSaleWatcherService'
info: OmniSharp.MSBuild.ProjectManager
Queue project update for '/home/ethanpreker/Repos/ProcessedSaleWatcherService/ProcessedSaleWatcherService.csproj'
info: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in '/home/ethanpreker/Repos/ProcessedSaleWatcherService'.
info: OmniSharp.Script.ScriptProjectSystem
Could not find any CSX files
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.EditorConfigWorkspaceOptionsProvider, Order: 200
info: OmniSharp.WorkspaceInitializer
Configuration finished.
info: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location '/home/ethanpreker/Repos/ProcessedSaleWatcherService' on host 5630.
info: OmniSharp.MSBuild.ProjectManager
Loading project: /home/ethanpreker/Repos/ProcessedSaleWatcherService/ProcessedSaleWatcherService.csproj
info: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file '/home/ethanpreker/Repos/ProcessedSaleWatcherService/ProcessedSaleWatcherService.csproj'.
info: OmniSharp.MSBuild.ProjectManager
Adding project '/home/ethanpreker/Repos/ProcessedSaleWatcherService/ProcessedSaleWatcherService.csproj'
info: OmniSharp.MSBuild.ProjectManager
Update project: ProcessedSaleWatcherService
info: OmniSharp.MSBuild.ProjectManager
Queue project update for '/home/ethanpreker/Repos/ProcessedSaleWatcherService/ProcessedSaleWatcherService.csproj'
info: OmniSharp.MSBuild.ProjectManager
Queue project update for '/home/ethanpreker/Repos/ProcessedSaleWatcherService/ProcessedSaleWatcherService.csproj'
info: OmniSharp.MSBuild.ProjectManager
Queue project update for '/home/ethanpreker/Repos/ProcessedSaleWatcherService/ProcessedSaleWatcherService.csproj'
info: OmniSharp.MSBuild.ProjectManager
Queue project update for '/home/ethanpreker/Repos/ProcessedSaleWatcherService/ProcessedSaleWatcherService.csproj'
info: OmniSharp.MSBuild.ProjectManager
Loading project: /home/ethanpreker/Repos/ProcessedSaleWatcherService/ProcessedSaleWatcherService.csproj
[warn]: OmniSharp.MSBuild.ProjectLoader
Package 'System.Net.Http.Formatting.Extension 5.2.3' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v3.0'. This package may not be fully compatible with your project.
info: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file '/home/ethanpreker/Repos/ProcessedSaleWatcherService/ProcessedSaleWatcherService.csproj'.
/home/ethanpreker/Repos/ProcessedSaleWatcherService/ProcessedSaleWatcherService.csproj
/home/ethanpreker/Repos/ProcessedSaleWatcherService/ProcessedSaleWatcherService.csproj(0,0): Error: Package 'System.Net.Http.Formatting.Extension 5.2.3' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v3.0'. This package may not be fully compatible with your project.
Update project: ProcessedSaleWatcherService
C# log
Environment information
VSCode version: 1.38.1
C# Extension: 1.21.4
Mono Information
OmniSharp using global mono :6.0.0Dotnet Information
.NET Core SDK (reflecting any global.json): Version: 3.0.100 Commit: 04339c3a26Runtime Environment:
OS Name: manjaro
OS Version:
OS Platform: Linux
RID: linux-x64
Base Path: /home/ethanpreker/.dotnet/sdk/3.0.100/
Host (useful for support):
Version: 3.0.0
Commit: 7d57652f33
.NET Core SDKs installed:
2.2.108 [/home/ethanpreker/.dotnet/sdk]
3.0.100 [/home/ethanpreker/.dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.2.6 [/home/ethanpreker/.dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.2.6 [/home/ethanpreker/.dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.0.0 [/home/ethanpreker/.dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.2.6 [/home/ethanpreker/.dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 3.0.0 [/home/ethanpreker/.dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
Visual Studio Code Extensions
The text was updated successfully, but these errors were encountered: