Closed kenjiuno closed 1 week ago
I am having the same issue in Manjaro, running export MSBuildSDKsPath=/opt/dotnet/sdk/2.2.100/Sdks
also worked as a workaround.
dotnet --info
output:
.NET Core SDK (reflecting any global.json):
Version: 2.2.100
Commit: b9f2fa0ca8
Runtime Environment:
OS Name: manjaro
OS Version:
OS Platform: Linux
RID: arch-x64
Base Path: /opt/dotnet/sdk/2.2.100/
Host (useful for support):
Version: 2.2.0
Commit: 1249f08fed
.NET Core SDKs installed:
2.2.100 [/opt/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.NETCore.App 2.2.0 [/opt/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
@matfantinel where did you run the export command?
@ksivasenthil on system's Terminal, before opening VS Code. Doesn't matter which folder you're on.
IMO This isn't an easy problem? Because MSBuildSDKsPath
depends on project's <TargetFramework>
.
My MSBuildSDKsPath for netcoreapp3.1
is:
set MSBuildSDKsPath=C:\Program Files\dotnet\sdk\3.1.101\Sdks
code .
csproj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.6.0" />
<PackageReference Include="CsvHelper" Version="15.0.0" />
<PackageReference Include="Dapper" Version="2.0.30" />
<PackageReference Include="npgsql" Version="4.1.2" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.0" />
</ItemGroup>
</Project>
A lot has changed with project loading since this issue as opened. If you are still running into problems, please open a new issue.
Environment data
dotnet --info
output:VS Code version:
1.30.0
C# Extension version:
1.17.1
Steps to reproduce
services.
Expected behavior
Try
before launching VSCode will be:
Actual behavior
Show Output
Entire log:
``` Starting OmniSharp server at 12/18/2018, 10:50:56 AM Target: d:\Proj\Oseibo OmniSharp server started. Path: C:\Users\USER\.vscode\extensions\ms-vscode.csharp-1.17.1\.omnisharp\1.32.8\OmniSharp.exe PID: 12812 [info]: OmniSharp.Stdio.Host Starting OmniSharp on Windows 6.2.9200.0 (x64) [info]: OmniSharp.Services.DotNetCliService DotNetPath set to dotnet [info]: OmniSharp.MSBuild.Discovery.MSBuildLocator Located 3 MSBuild instance(s) 1: Visual Studio 2017 Desktop Express 15.8.28010.2050 - "C:\Program Files (x86)\Microsoft Visual Studio\2017\WDExpress\MSBuild\15.0\Bin" 2: Visual Studio Professional 2017 15.8.28010.2050 - "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin" 3: StandAlone 15.0 - "C:\Users\USER\.vscode\extensions\ms-vscode.csharp-1.17.1\.omnisharp\1.32.8\msbuild\15.0\Bin" [info]: OmniSharp.MSBuild.Discovery.MSBuildLocator Registered MSBuild instance: Visual Studio 2017 Desktop Express 15.8.28010.2050 - "C:\Program Files (x86)\Microsoft Visual Studio\2017\WDExpress\MSBuild\15.0\Bin" [info]: OmniSharp.Cake.CakeProjectSystem Detecting Cake files in 'd:\Proj\Oseibo'. [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 'd:\Proj\Oseibo' [info]: OmniSharp.MSBuild.ProjectManager Queue project update for 'd:\Proj\Oseibo\Oseibo.csproj' [info]: OmniSharp.Script.ScriptProjectSystem Detecting CSX files in 'd:\Proj\Oseibo'. [info]: OmniSharp.Script.ScriptProjectSystem Could not find any CSX files [info]: OmniSharp.WorkspaceInitializer Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpWorkspaceOptionsProvider [info]: OmniSharp.MSBuild.ProjectManager Loading project: d:\Proj\Oseibo\Oseibo.csproj [info]: OmniSharp.WorkspaceInitializer Configuration finished. [info]: OmniSharp.Stdio.Host Omnisharp server running using Stdio at location 'd:\Proj\Oseibo' on host 6564. [warn]: OmniSharp.MSBuild.ProjectManager Failed to load project file 'd:\Proj\Oseibo\Oseibo.csproj'. d:\Proj\Oseibo\Oseibo.csproj(1,1) Microsoft.Build.Exceptions.InvalidProjectFileException: 指定された SDK 'Microsoft.NET.Sdk.Web' は見つかりませんでした。 d:\Proj\Oseibo\Oseibo.csproj 場所 Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject(String errorSubCategoryResourceName, IElementLocation elementLocation, String resourceName, Object[] args) 場所 Microsoft.Build.Evaluation.Evaluator`4.ExpandAndLoadImportsFromUnescapedImportExpressionConditioned(String directoryOfImportingFile, ProjectImportElement importElement, List`1& projects, SdkResult& sdkResult, Boolean throwOnFileNotExistsError) 場所 Microsoft.Build.Evaluation.Evaluator`4.ExpandAndLoadImports(String directoryOfImportingFile, ProjectImportElement importElement, SdkResult& sdkResult) 場所 Microsoft.Build.Evaluation.Evaluator`4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement) 場所 Microsoft.Build.Evaluation.Evaluator`4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport) 場所 Microsoft.Build.Evaluation.Evaluator`4.Evaluate(ILoggingService loggingService, BuildEventContext buildEventContext) 場所 Microsoft.Build.Evaluation.Project.Reevaluate(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext) 場所 Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext) 場所 Microsoft.Build.Evaluation.Project.Initialize(IDictionary`2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext) 場所 Microsoft.Build.Evaluation.Project..ctor(String projectFile, IDictionary`2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext) 場所 Microsoft.Build.Evaluation.ProjectCollection.LoadProject(String fileName, IDictionary`2 globalProperties, String toolsVersion) 場所 OmniSharp.MSBuild.ProjectLoader.EvaluateProjectFileCore(String filePath) 場所 OmniSharp.MSBuild.ProjectLoader.BuildProject(String filePath) 場所 OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.Load(String filePath, ProjectLoader loader) 場所 OmniSharp.MSBuild.ProjectManager.LoadOrReloadProject(String projectFilePath, Func`1 loader) [fail]: OmniSharp.MSBuild.ProjectManager Attemped to update project that is not loaded: d:\Proj\Oseibo\Oseibo.csproj ```Point
1: Visual Studio 2017 Desktop Express
seems to be selected. I prefer2: Visual Studio Professional 2017
as a primary selection.