vscode-csharp icon indicating copy to clipboard operation
vscode-csharp copied to clipboard

omni sharp in vs code portable and dotnet core binary zip file

Open mammadkoma opened this issue 7 years ago • 5 comments

Hi I can not install any program on my windows for network policies reason. So I downloaded VS Code portable and open it. Also I downloaded dot net core library zip file and extract it in : C:\dotnet I opened vs code and open folder C:\MVC3 and type c:\dotnet\dotnet.exe new mvc in terminal Then dotnet run command and project run perfectly. Now I just want to start Debugging in vs code but give me error : launch: program '' does not exist. VS Code can not find dot net core cli because I can not install any program and I can not copy dotnet folder to C:\Program Files because I have not the admin user pass. Just tell me how can I set a setting for VS Code to define dotnet core path to C:\dotnet?

in output : Starting OmniSharp server at 1/2/2019, 9:39:01 AM Target: c:\MVC3

OmniSharp server started. Path: E:\My Pro\VS Code\data\extensions\ms-vscode.csharp-1.17.1.omnisharp\1.32.8\OmniSharp.exe PID: 12104

Starting OmniSharp on Windows 6.2.9200.0 (x64) info: OmniSharp.Services.DotNetCliService DotNetPath set to dotnet info: OmniSharp.MSBuild.Discovery.MSBuildLocator Located 1 MSBuild instance(s) 1: StandAlone 15.0 - "E:\My Pro\VS Code\data\extensions\ms-vscode.csharp-1.17.1.omnisharp\1.32.8\msbuild\15.0\Bin" info: OmniSharp.MSBuild.Discovery.MSBuildLocator MSBUILD_EXE_PATH environment variable set to 'E:\My Pro\VS Code\data\extensions\ms-vscode.csharp-1.17.1.omnisharp\1.32.8\msbuild\15.0\Bin\MSBuild.exe' info: OmniSharp.MSBuild.Discovery.MSBuildLocator Registered MSBuild instance: StandAlone 15.0 - "E:\My Pro\VS Code\data\extensions\ms-vscode.csharp-1.17.1.omnisharp\1.32.8\msbuild\15.0\Bin" CscToolExe = csc.exe CscToolPath = E:\My Pro\VS Code\data\extensions\ms-vscode.csharp-1.17.1.omnisharp\1.32.8\msbuild\15.0\Bin\Roslyn MSBuildExtensionsPath = E:\My Pro\VS Code\data\extensions\ms-vscode.csharp-1.17.1.omnisharp\1.32.8\msbuild MSBuildToolsPath = E:\My Pro\VS Code\data\extensions\ms-vscode.csharp-1.17.1.omnisharp\1.32.8\msbuild\15.0\Bin info: OmniSharp.Cake.CakeProjectSystem Detecting Cake files in 'c:\MVC3'. info: OmniSharp.Cake.CakeProjectSystem Could not find any Cake files info: OmniSharp.WorkspaceInitializer Project system 'OmniSharp.DotNet.DotNetProjectSystem' is disabled in the configuration. info: OmniSharp.MSBuild.ProjectSystem No solution files found in 'c:\MVC3' info: OmniSharp.MSBuild.ProjectManager Queue project update for 'c:\MVC3\MVC3.csproj' info: OmniSharp.Script.ScriptProjectSystem Detecting CSX files in 'c:\MVC3'. info: OmniSharp.MSBuild.ProjectManager Loading project: c:\MVC3\MVC3.csproj info: OmniSharp.Script.ScriptProjectSystem Could not find any CSX files info: OmniSharp.WorkspaceInitializer Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpWorkspaceOptionsProvider info: OmniSharp.WorkspaceInitializer Configuration finished. info: OmniSharp.Stdio.Host Omnisharp server running using Stdio at location 'c:\MVC3' on host 6024. [warn]: OmniSharp.MSBuild.ProjectManager Failed to load project file 'c:\MVC3\MVC3.csproj'. c:\MVC3\MVC3.csproj(1,1) Microsoft.Build.Exceptions.InvalidProjectFileException: The SDK 'Microsoft.NET.Sdk.Web' specified could not be found. c:\MVC3\MVC3.csproj at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject(String errorSubCategoryResourceName, IElementLocation elementLocation, String resourceName, Object[] args) at Microsoft.Build.Evaluation.Evaluator4.ExpandAndLoadImportsFromUnescapedImportExpressionConditioned(String directoryOfImportingFile, ProjectImportElement importElement, List1& projects, Boolean throwOnFileNotExistsError) at Microsoft.Build.Evaluation.Evaluator4.ExpandAndLoadImports(String directoryOfImportingFile, ProjectImportElement importElement) at Microsoft.Build.Evaluation.Evaluator4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement) at Microsoft.Build.Evaluation.Evaluator4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport) at Microsoft.Build.Evaluation.Evaluator4.Evaluate(ILoggingService loggingService, BuildEventContext buildEventContext) at Microsoft.Build.Evaluation.Project.Reevaluate(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings) at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings) at Microsoft.Build.Evaluation.Project.Initialize(IDictionary2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectLoadSettings loadSettings) at Microsoft.Build.Evaluation.Project..ctor(String projectFile, IDictionary2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings) at Microsoft.Build.Evaluation.ProjectCollection.LoadProject(String fileName, IDictionary2 globalProperties, String toolsVersion) at OmniSharp.MSBuild.ProjectLoader.EvaluateProjectFileCore(String filePath) at OmniSharp.MSBuild.ProjectLoader.BuildProject(String filePath) at OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.Load(String filePath, ProjectLoader loader) at OmniSharp.MSBuild.ProjectManager.LoadOrReloadProject(String projectFilePath, Func1 loader)

Attemped to update project that is not loaded: c:\MVC3\MVC3.csproj

mammadkoma avatar Jan 02 '19 06:01 mammadkoma

@mammadkoma You need to add c:\dotnet\ to your PATH environment variable.

rchande avatar Jan 02 '19 16:01 rchande

oooooh Thank you But I could not open Advanced system settings. And by help of this link I can open user variables and added c:\dotnet\ to path: How to set Path in Windows without admin rights Every problems solved. Thank you

mammadkoma avatar Jan 05 '19 05:01 mammadkoma

@rchande also how do you setup the same in MAC OS X? i am getting the below error while trying to debug my c# code launch: program '/Users/pranaleedoijad/Documents/CSharp_Practice/bin/Debug/netcore3.1/CSharp_Practice.dll' does not exist.

pranaleedoijad avatar Feb 18 '20 01:02 pranaleedoijad

@pranaleedoijad I'm not sure your issue is related. Can you open a new issue and provide all the requested logs? Thanks

JoeRobich avatar Feb 18 '20 18:02 JoeRobich

Please see https://dotnetresolutions.wordpress.com/2020/05/21/making-net-core-binaries-work-with-visual-studio-code

agawasare avatar May 21 '20 15:05 agawasare