Skip to content
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

.Net Framework 4.6.1 omnicharp intellisense abd highlight broken. #5352

Closed
Edemilorhea opened this issue Aug 22, 2022 · 10 comments · Fixed by OmniSharp/omnisharp-roslyn#2443
Closed

Comments

@Edemilorhea
Copy link

.NET SDK (reflecting any global.json):

Version: 6.0.400
Commit: 7771abd614

執行階段環境:
OS Name: Windows
OS Version: 10.0.22000
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\6.0.400\

global.json file:
Not found

Host:
Version: 6.0.8
Architecture: x64
Commit: 55fb7ef977

.NET SDKs installed:
6.0.302 [C:\Program Files\dotnet\sdk]
6.0.400 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.7 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

VScode Version:
Version: 1.70.0 (user setup)

C# extension version: v1.25.0

OmniSharp log (IF Use Modern Net is False)

Failed to load project file 'd:\工作\WATCHVES\專案\VES_Web\Working\WatchsoftAms\WatchsoftAms\WatchsoftAms.csproj'.
System.MissingMethodException: 找不到方法: 'System.ReadOnlySpan1<Char> Microsoft.IO.Path.GetFileName(System.ReadOnlySpan1)'。
於 Microsoft.Build.Shared.FileMatcher.IsFileNameMatch(String path, String pattern)
於 System.Linq.Enumerable.WhereArrayIterator1.MoveNext() 於 System.Linq.Buffer1..ctor(IEnumerable1 source) 於 System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source)
於 Microsoft.Build.Shared.FileMatcher.GetFilesForStep(RecursiveStepResult stepResult, RecursionState recursionState, String projectDirectory, Boolean stripProjectDirectory)
於 Microsoft.Build.Shared.FileMatcher.GetFilesRecursive(ConcurrentStack1 listOfFiles, RecursionState recursionState, String projectDirectory, Boolean stripProjectDirectory, IList1 searchesToExclude, Dictionary2 searchesToExcludeInSubdirs, TaskOptions taskOptions) 於 Microsoft.Build.Shared.FileMatcher.GetFilesImplementation(String projectDirectoryUnescaped, String filespecUnescaped, List1 excludeSpecsUnescaped)
於 Microsoft.Build.Shared.FileMatcher.<>c__DisplayClass67_0.b__1(String _)
於 System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory)
於 Microsoft.Build.Shared.FileMatcher.GetFiles(String projectDirectoryUnescaped, String filespecUnescaped, List1 excludeSpecsUnescaped) 於 Microsoft.Build.Internal.EngineFileUtilities.GetFileList(String directoryEscaped, String filespecEscaped, Boolean returnEscaped, Boolean forceEvaluateWildCards, IEnumerable1 excludeSpecsEscaped, FileMatcher fileMatcher, Object loggingMechanism, IElementLocation includeLocation, IElementLocation excludeLocation, IElementLocation importLocation, BuildEventContext buildEventContext, String buildEventFileInfoFullPath, Boolean disableExcludeDriveEnumerationWarning)
於 Microsoft.Build.Internal.EngineFileUtilities.GetFileListEscaped(String directoryEscaped, String filespecEscaped, IEnumerable1 excludeSpecsEscaped, Boolean forceEvaluate, FileMatcher fileMatcher, Object loggingMechanism, IElementLocation includeLocation, IElementLocation excludeLocation, IElementLocation importLocation, BuildEventContext buildEventContext, String buildEventFileInfoFullPath, Boolean disableExcludeDriveEnumerationWarning) 於 Microsoft.Build.Evaluation.Evaluator4.ExpandAndLoadImportsFromUnescapedImportExpression(String directoryOfImportingFile, ProjectImportElement importElement, String unescapedExpression, Boolean throwOnFileNotExistsError, List1& imports) 於 Microsoft.Build.Evaluation.Evaluator4.ExpandAndLoadImportsFromUnescapedImportExpressionConditioned(String directoryOfImportingFile, ProjectImportElement importElement, List1& projects, SdkResult& sdkResult, Boolean throwOnFileNotExistsError) 於 Microsoft.Build.Evaluation.Evaluator4.ExpandAndLoadImports(String directoryOfImportingFile, ProjectImportElement importElement, SdkResult& sdkResult)
於 Microsoft.Build.Evaluation.Evaluator4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement) 於 Microsoft.Build.Evaluation.Evaluator4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
於 Microsoft.Build.Evaluation.Evaluator4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement) 於 Microsoft.Build.Evaluation.Evaluator4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
於 Microsoft.Build.Evaluation.Evaluator4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement) 於 Microsoft.Build.Evaluation.Evaluator4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
於 Microsoft.Build.Evaluation.Evaluator4.Evaluate() 於 Microsoft.Build.Evaluation.Evaluator4.Evaluate(IEvaluatorData4 data, Project project, ProjectRootElement root, ProjectLoadSettings loadSettings, Int32 maxNodeCount, PropertyDictionary1 environmentProperties, ILoggingService loggingService, IItemFactory2 itemFactory, IToolsetProvider toolsetProvider, ProjectRootElementCacheBase projectRootElementCache, BuildEventContext buildEventContext, ISdkResolverService sdkResolverService, Int32 submissionId, EvaluationContext evaluationContext, Boolean interactive) 於 Microsoft.Build.Evaluation.Project.ProjectImpl.Reevaluate(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext) 於 Microsoft.Build.Evaluation.Project.ProjectImpl.ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext) 於 Microsoft.Build.Evaluation.Project.ProjectImpl.ReevaluateIfNecessary(EvaluationContext evaluationContext) 於 Microsoft.Build.Evaluation.Project.ProjectImpl.Initialize(IDictionary2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
於 Microsoft.Build.Evaluation.Project..ctor(String projectFile, IDictionary2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext, IDirectoryCacheFactory directoryCacheFactory) 於 Microsoft.Build.Evaluation.ProjectCollection.LoadProject(String fileName, IDictionary2 globalProperties, String toolsVersion)
於 OmniSharp.MSBuild.ProjectLoader.EvaluateProjectFileCore(String filePath, IReadOnlyDictionary2 projectConfigurationsInSolution, IList1 loggers) 於 D:\a\1\s\src\OmniSharp.MSBuild\ProjectLoader.cs: 行 160
於 OmniSharp.MSBuild.ProjectLoader.BuildProject(String filePath, IReadOnlyDictionary2 configurationsInSolution) 於 D:\a\1\s\src\OmniSharp.MSBuild\ProjectLoader.cs: 行 84 於 OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.Load(String filePath, ProjectIdInfo projectIdInfo, ProjectLoader loader, Guid sessionId, DotNetInfo dotNetInfo) 於 D:\a\1\s\src\OmniSharp.MSBuild\ProjectFile\ProjectFileInfo.cs: 行 117 於 OmniSharp.MSBuild.ProjectManager.<>c__DisplayClass32_0.<LoadProject>b__0() 於 D:\a\1\s\src\OmniSharp.MSBuild\ProjectManager.cs: 行 305 於 OmniSharp.MSBuild.ProjectManager.LoadOrReloadProject(String projectFilePath, Func1 loader) 於 D:\a\1\s\src\OmniSharp.MSBuild\ProjectManager.cs: 行 316
d:\工作\WATCHVES\專案\VES_Web\Working\WatchsoftAms\WatchsoftAms\WatchsoftAms.csproj(0,0)
System.MissingMethodException: 找不到方法: 'System.ReadOnlySpan1<Char> Microsoft.IO.Path.GetFileName(System.ReadOnlySpan1)'。
於 Microsoft.Build.Shared.FileMatcher.IsFileNameMatch(String path, String pattern)
於 System.Linq.Enumerable.WhereArrayIterator1.MoveNext() 於 System.Linq.Buffer1..ctor(IEnumerable1 source) 於 System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source)
於 Microsoft.Build.Shared.FileMatcher.GetFilesForStep(RecursiveStepResult stepResult, RecursionState recursionState, String projectDirectory, Boolean stripProjectDirectory)
於 Microsoft.Build.Shared.FileMatcher.GetFilesRecursive(ConcurrentStack1 listOfFiles, RecursionState recursionState, String projectDirectory, Boolean stripProjectDirectory, IList1 searchesToExclude, Dictionary2 searchesToExcludeInSubdirs, TaskOptions taskOptions) 於 Microsoft.Build.Shared.FileMatcher.GetFilesImplementation(String projectDirectoryUnescaped, String filespecUnescaped, List1 excludeSpecsUnescaped)
於 Microsoft.Build.Shared.FileMatcher.<>c__DisplayClass67_0.b__1(String _)
於 System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory)
於 Microsoft.Build.Shared.FileMatcher.GetFiles(String projectDirectoryUnescaped, String filespecUnescaped, List1 excludeSpecsUnescaped) 於 Microsoft.Build.Internal.EngineFileUtilities.GetFileList(String directoryEscaped, String filespecEscaped, Boolean returnEscaped, Boolean forceEvaluateWildCards, IEnumerable1 excludeSpecsEscaped, FileMatcher fileMatcher, Object loggingMechanism, IElementLocation includeLocation, IElementLocation excludeLocation, IElementLocation importLocation, BuildEventContext buildEventContext, String buildEventFileInfoFullPath, Boolean disableExcludeDriveEnumerationWarning)
於 Microsoft.Build.Internal.EngineFileUtilities.GetFileListEscaped(String directoryEscaped, String filespecEscaped, IEnumerable1 excludeSpecsEscaped, Boolean forceEvaluate, FileMatcher fileMatcher, Object loggingMechanism, IElementLocation includeLocation, IElementLocation excludeLocation, IElementLocation importLocation, BuildEventContext buildEventContext, String buildEventFileInfoFullPath, Boolean disableExcludeDriveEnumerationWarning) 於 Microsoft.Build.Evaluation.Evaluator4.ExpandAndLoadImportsFromUnescapedImportExpression(String directoryOfImportingFile, ProjectImportElement importElement, String unescapedExpression, Boolean throwOnFileNotExistsError, List1& imports) 於 Microsoft.Build.Evaluation.Evaluator4.ExpandAndLoadImportsFromUnescapedImportExpressionConditioned(String directoryOfImportingFile, ProjectImportElement importElement, List1& projects, SdkResult& sdkResult, Boolean throwOnFileNotExistsError) 於 Microsoft.Build.Evaluation.Evaluator4.ExpandAndLoadImports(String directoryOfImportingFile, ProjectImportElement importElement, SdkResult& sdkResult)
於 Microsoft.Build.Evaluation.Evaluator4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement) 於 Microsoft.Build.Evaluation.Evaluator4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
於 Microsoft.Build.Evaluation.Evaluator4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement) 於 Microsoft.Build.Evaluation.Evaluator4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
於 Microsoft.Build.Evaluation.Evaluator4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement) 於 Microsoft.Build.Evaluation.Evaluator4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
於 Microsoft.Build.Evaluation.Evaluator4.Evaluate() 於 Microsoft.Build.Evaluation.Evaluator4.Evaluate(IEvaluatorData4 data, Project project, ProjectRootElement root, ProjectLoadSettings loadSettings, Int32 maxNodeCount, PropertyDictionary1 environmentProperties, ILoggingService loggingService, IItemFactory2 itemFactory, IToolsetProvider toolsetProvider, ProjectRootElementCacheBase projectRootElementCache, BuildEventContext buildEventContext, ISdkResolverService sdkResolverService, Int32 submissionId, EvaluationContext evaluationContext, Boolean interactive) 於 Microsoft.Build.Evaluation.Project.ProjectImpl.Reevaluate(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext) 於 Microsoft.Build.Evaluation.Project.ProjectImpl.ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext) 於 Microsoft.Build.Evaluation.Project.ProjectImpl.ReevaluateIfNecessary(EvaluationContext evaluationContext) 於 Microsoft.Build.Evaluation.Project.ProjectImpl.Initialize(IDictionary2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
於 Microsoft.Build.Evaluation.Project..ctor(String projectFile, IDictionary2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext, IDirectoryCacheFactory directoryCacheFactory) 於 Microsoft.Build.Evaluation.ProjectCollection.LoadProject(String fileName, IDictionary2 globalProperties, String toolsVersion)
於 OmniSharp.MSBuild.ProjectLoader.EvaluateProjectFileCore(String filePath, IReadOnlyDictionary2 projectConfigurationsInSolution, IList1 loggers) 於 D:\a\1\s\src\OmniSharp.MSBuild\ProjectLoader.cs: 行 160
於 OmniSharp.MSBuild.ProjectLoader.BuildProject(String filePath, IReadOnlyDictionary2 configurationsInSolution) 於 D:\a\1\s\src\OmniSharp.MSBuild\ProjectLoader.cs: 行 84 於 OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.Load(String filePath, ProjectIdInfo projectIdInfo, ProjectLoader loader, Guid sessionId, DotNetInfo dotNetInfo) 於 D:\a\1\s\src\OmniSharp.MSBuild\ProjectFile\ProjectFileInfo.cs: 行 117 於 OmniSharp.MSBuild.ProjectManager.<>c__DisplayClass32_0.<LoadProject>b__0() 於 D:\a\1\s\src\OmniSharp.MSBuild\ProjectManager.cs: 行 305 於 OmniSharp.MSBuild.ProjectManager.LoadOrReloadProject(String projectFilePath, Func1 loader) 於 D:\a\1\s\src\OmniSharp.MSBuild\ProjectManager.cs: 行 316

Attempted to update project that is not loaded: d:\工作\WATCHVES\專案\VES_Web\Working\WatchsoftAms\WatchsoftAms\WatchsoftAms.csproj

OmniSharp log (IF Use Modern Net is True)

Target: d:\工作\WATCHVES\專案\VES_Web\Working\WatchsoftAms\WatchsoftAms

OmniSharp server started with .NET 6.0.400
.
Path: c:\Users\leon8.vscode\extensions\ms-dotnettools.csharp-1.25.0-win32-x64.omnisharp\1.39.0-net6.0\OmniSharp.dll
PID: 13860

d:\工作\WATCHVES\專案\VES_Web\Working\WatchsoftAms\WatchsoftAms\WatchsoftAms.csproj
C:\Program Files\dotnet\sdk\6.0.400\Microsoft.CSharp.CurrentVersion.targets(129,9): Error: 找不到規則集檔案 "ManagedMinimumRules.ruleset"。

Received response for /findusages but could not find request.
Received response for /v2/getcodeactions but could not find request.

Steps to reproduce

first case:

  1. disable Use Modern Net
  2. reload omnisharp
  3. get first Part omnisharp log, is OmniSharp.MSBuild.ProjectManager Attempted to update project that is not loadedr.

1.enable Use Modern Net
2.reload omnisharp
3. get second Part omnisharp log, is Microsoft.CSharp.CurrentVersion.targets(129,9): Error: 找不到規則集檔案 "ManagedMinimumRules.ruleset"。
4. go to controller type something will omnisharp will report Received response for /findusages but could not find request. and Received response for /v2/getcodeactions but could not find request.

Expected behavior

success load project IntelliSense and highlight is working

Actual behavior

My project is .Net framework v4.6.1, So I think I should be disable UseModernNet, But it loading the project will fail.

I tried to enable UseModernNet , It will load project success but it will not found ManagedMinimumRules.ruleset, and type something will not find request.

@JoeRobich
Copy link
Member

JoeRobich commented Aug 22, 2022

@Edemilorhea If your Full Framework project is not using the new SDK-style project. You can using the try-convert dotnet tool (link) to convert from the old-style project to an SDK-style project. Or you can disable omnisharp.useModernNet. This would require you to install the Visual Studio Build Tools to load your project. You can find links to download it from our requirements https://github.com/OmniSharp/omnisharp-vscode#requirements

@Edemilorhea
Copy link
Author

Edemilorhea commented Aug 23, 2022

@JoeRobich
Hello JoeRobich thanks your reply , I have tried to disable omnisharp.useModernNet, and already installed Visual Studio Build Tools, But it still dosn't load project successful.

I wanna try to use try-convert dotnet tool, But this is my project at the work, So idk if i convert it, Can anyone else successfully read it?

update:
I found OmniSharp doen't load myproject.sln, it's load path is wrong, my project sln at C:XXXX\Myproject\Myproject.sln, but it load path is C:XXXX\Myproject\Myproject\Myproject.sln it path same to Myproject.csproj folad.

IDK how to change load .sln path, so I move .sln in to next folder ( I don't know can i do this? ) ,anyway it looks like load successful, But it have other wrong still not have intellisense and highlight.

No symbol found. File: c:\VES_Web\Working\WatchsoftAms\WatchsoftAms\Controllers\XXXX.cs, Line: 77, Column: 47.

@JoeRobich
Copy link
Member

I found OmniSharp doen't load myproject.sln, it's load path is wrong, my project sln at C:XXXX\Myproject\Myproject.sln, but it load path is C:XXXX\Myproject\Myproject\Myproject.sln it path same to Myproject.csproj folad.

@Edemilorhea This sounds very odd. If you have omnisharp.defaultLaunchSolution set in your settings, try clearing it.

Could you share the OmniSharp Log from the Output pane now that you have gotten farther?

@Edemilorhea
Copy link
Author

omnisharp.defaultLaunchSolution is not set anything.

This is dosen't use modern net:

Starting OmniSharp server at 2022/8/26 上午9:40:17
Target: c:\TC\project\VES_Web\Working\Ves6WebSale\Ves6WebSale.sln

OmniSharp server started with .NET 6.0.400
.
Path: c:\Users\troy.callahan.vscode\extensions\ms-dotnettools.csharp-1.25.0-win32-x64.omnisharp\1.39.2-beta.10-net6.0\OmniSharp.dll
PID: 14728

Starting OmniSharp on Windows 10.0.19045.0 (x64)
info: OmniSharp.Services.DotNetCliService
Checking the 'DOTNET_ROOT' environment variable to find a .NET SDK
info: OmniSharp.Services.DotNetCliService
Using the 'dotnet' on the PATH.
info: OmniSharp.Services.DotNetCliService
DotNetPath set to dotnet
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 1 MSBuild instance(s)
1: .NET Core SDK 6.0.400 17.3.0 - "C:\Program Files\dotnet\sdk\6.0.400"
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: .NET Core SDK 6.0.400 17.3.0 - "C:\Program Files\dotnet\sdk\6.0.400"
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
info: OmniSharp.MSBuild.ProjectSystem
Detecting projects in 'c:\TC\project\VES_Web\Working\Ves6WebSale\Ves6WebSale.sln'.
info: OmniSharp.MSBuild.ProjectManager
Queue project update for 'c:\TC\project\VES_Web\Working\Ves6WebSale\Ves6WebSale\Ves6WebSale.csproj'
info: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in 'c:\TC\project\VES_Web\Working\Ves6WebSale'.
info: OmniSharp.Script.ScriptProjectSystem
Did not find any CSX files
info: OmniSharp.WorkspaceInitializer
Configuration finished.
info: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location 'c:\TC\project\VES_Web\Working\Ves6WebSale' on host 1660.
info: OmniSharp.MSBuild.ProjectManager
Loading project: c:\TC\project\VES_Web\Working\Ves6WebSale\Ves6WebSale\Ves6WebSale.csproj
[warn]: OmniSharp.MSBuild.ProjectLoader
找不到規則集檔案 "ManagedMinimumRules.ruleset"。
info: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file 'c:\TC\project\VES_Web\Working\Ves6WebSale\Ves6WebSale\Ves6WebSale.csproj'.
c:\TC\project\VES_Web\Working\Ves6WebSale\Ves6WebSale\Ves6WebSale.csproj
C:\Program Files\dotnet\sdk\6.0.400\Microsoft.CSharp.CurrentVersion.targets(129,9): Error: 找不到規則集檔案 "ManagedMinimumRules.ruleset"。

Adding project 'c:\TC\project\VES_Web\Working\Ves6WebSale\Ves6WebSale\Ves6WebSale.csproj'
info: OmniSharp.MSBuild.ProjectManager
Update project: Ves6WebSale
info: OmniSharp.Roslyn.CSharp.Services.Diagnostics.CSharpDiagnosticWorkerWithAnalyzers
Solution initialized -> queue all documents for code analysis. Initial document count: 33.
[warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService
No symbol found. File: c:\TC\project\VES_Web\Working\Ves6WebSale\Ves6WebSale\Controllers\MyListController.cs, Line: 0, Column: 0.
[warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService
No symbol found. File: c:\TC\project\VES_Web\Working\Ves6WebSale\Ves6WebSale\Controllers\MyListController.cs, Line: 25, Column: 18.
[warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService
No symbol found. File: c:\TC\project\VES_Web\Working\Ves6WebSale\Ves6WebSale\Controllers\MyListController.cs, Line: 25, Column: 17.
Received response for /quickinfo but could not find request.

This is use modern net

Starting OmniSharp server at 2022/8/26 上午10:01:07
Target: c:\TC\project\VES_Web\Working\Ves6WebSale\Ves6WebSale.sln

OmniSharp server started.
Path: c:\Users\troy.callahan.vscode\extensions\ms-dotnettools.csharp-1.25.0-win32-x64.omnisharp\1.39.2-beta.10\OmniSharp.exe
PID: 19420

Starting OmniSharp on Windows 6.2.9200.0 (x64)
info: OmniSharp.Services.DotNetCliService
Checking the 'DOTNET_ROOT' environment variable to find a .NET SDK
info: OmniSharp.Services.DotNetCliService
Using the 'dotnet' on the PATH.
info: OmniSharp.Services.DotNetCliService
DotNetPath set to dotnet
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 1 MSBuild instance(s)
1: Visual Studio Community 2022 17.3.32819.101 17.3.1 - "C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin"
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: Visual Studio Community 2022 17.3.32819.101 17.3.1 - "C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin"
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
info: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in 'c:\TC\project\VES_Web\Working\Ves6WebSale'.
info: OmniSharp.Cake.CakeProjectSystem
Did not find any Cake files
info: OmniSharp.MSBuild.ProjectSystem
Detecting projects in 'c:\TC\project\VES_Web\Working\Ves6WebSale\Ves6WebSale.sln'.
info: OmniSharp.MSBuild.ProjectManager
Queue project update for 'c:\TC\project\VES_Web\Working\Ves6WebSale\Ves6WebSale\Ves6WebSale.csproj'
info: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in 'c:\TC\project\VES_Web\Working\Ves6WebSale'.
info: OmniSharp.Script.ScriptProjectSystem
Did not find any CSX files
info: OmniSharp.WorkspaceInitializer
Configuration finished.
info: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location 'c:\TC\project\VES_Web\Working\Ves6WebSale' on host 1660.
info: OmniSharp.MSBuild.ProjectManager
Loading project: c:\TC\project\VES_Web\Working\Ves6WebSale\Ves6WebSale\Ves6WebSale.csproj
fail: OmniSharp.MSBuild.ProjectManager
Failed to load project file 'c:\TC\project\VES_Web\Working\Ves6WebSale\Ves6WebSale\Ves6WebSale.csproj'.
System.MissingMethodException: 找不到方法: 'System.ReadOnlySpan1<Char> Microsoft.IO.Path.GetFileName(System.ReadOnlySpan1)'。
於 Microsoft.Build.Shared.FileMatcher.IsFileNameMatch(String path, String pattern)
於 System.Linq.Enumerable.WhereArrayIterator1.MoveNext() 於 System.Linq.Buffer1..ctor(IEnumerable1 source) 於 System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source)
於 Microsoft.Build.Shared.FileMatcher.GetFilesForStep(RecursiveStepResult stepResult, RecursionState recursionState, String projectDirectory, Boolean stripProjectDirectory)
於 Microsoft.Build.Shared.FileMatcher.GetFilesRecursive(ConcurrentStack1 listOfFiles, RecursionState recursionState, String projectDirectory, Boolean stripProjectDirectory, IList1 searchesToExclude, Dictionary2 searchesToExcludeInSubdirs, TaskOptions taskOptions) 於 Microsoft.Build.Shared.FileMatcher.GetFilesImplementation(String projectDirectoryUnescaped, String filespecUnescaped, List1 excludeSpecsUnescaped)
於 Microsoft.Build.Shared.FileMatcher.<>c__DisplayClass67_0.b__1(String _)
於 System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory)
於 Microsoft.Build.Shared.FileMatcher.GetFiles(String projectDirectoryUnescaped, String filespecUnescaped, List1 excludeSpecsUnescaped) 於 Microsoft.Build.Internal.EngineFileUtilities.GetFileList(String directoryEscaped, String filespecEscaped, Boolean returnEscaped, Boolean forceEvaluateWildCards, IEnumerable1 excludeSpecsEscaped, FileMatcher fileMatcher, Object loggingMechanism, IElementLocation includeLocation, IElementLocation excludeLocation, IElementLocation importLocation, BuildEventContext buildEventContext, String buildEventFileInfoFullPath, Boolean disableExcludeDriveEnumerationWarning)
於 Microsoft.Build.Internal.EngineFileUtilities.GetFileListEscaped(String directoryEscaped, String filespecEscaped, IEnumerable1 excludeSpecsEscaped, Boolean forceEvaluate, FileMatcher fileMatcher, Object loggingMechanism, IElementLocation includeLocation, IElementLocation excludeLocation, IElementLocation importLocation, BuildEventContext buildEventContext, String buildEventFileInfoFullPath, Boolean disableExcludeDriveEnumerationWarning) 於 Microsoft.Build.Evaluation.Evaluator4.ExpandAndLoadImportsFromUnescapedImportExpression(String directoryOfImportingFile, ProjectImportElement importElement, String unescapedExpression, Boolean throwOnFileNotExistsError, List1& imports) 於 Microsoft.Build.Evaluation.Evaluator4.ExpandAndLoadImportsFromUnescapedImportExpressionConditioned(String directoryOfImportingFile, ProjectImportElement importElement, List1& projects, SdkResult& sdkResult, Boolean throwOnFileNotExistsError) 於 Microsoft.Build.Evaluation.Evaluator4.ExpandAndLoadImports(String directoryOfImportingFile, ProjectImportElement importElement, SdkResult& sdkResult)
於 Microsoft.Build.Evaluation.Evaluator4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement) 於 Microsoft.Build.Evaluation.Evaluator4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
於 Microsoft.Build.Evaluation.Evaluator4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement) 於 Microsoft.Build.Evaluation.Evaluator4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
於 Microsoft.Build.Evaluation.Evaluator4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement) 於 Microsoft.Build.Evaluation.Evaluator4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
於 Microsoft.Build.Evaluation.Evaluator4.Evaluate() 於 Microsoft.Build.Evaluation.Evaluator4.Evaluate(IEvaluatorData4 data, Project project, ProjectRootElement root, ProjectLoadSettings loadSettings, Int32 maxNodeCount, PropertyDictionary1 environmentProperties, ILoggingService loggingService, IItemFactory2 itemFactory, IToolsetProvider toolsetProvider, ProjectRootElementCacheBase projectRootElementCache, BuildEventContext buildEventContext, ISdkResolverService sdkResolverService, Int32 submissionId, EvaluationContext evaluationContext, Boolean interactive) 於 Microsoft.Build.Evaluation.Project.ProjectImpl.Reevaluate(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext) 於 Microsoft.Build.Evaluation.Project.ProjectImpl.ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext) 於 Microsoft.Build.Evaluation.Project.ProjectImpl.ReevaluateIfNecessary(EvaluationContext evaluationContext) 於 Microsoft.Build.Evaluation.Project.ProjectImpl.Initialize(IDictionary2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
於 Microsoft.Build.Evaluation.Project..ctor(String projectFile, IDictionary2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext, IDirectoryCacheFactory directoryCacheFactory) 於 Microsoft.Build.Evaluation.ProjectCollection.LoadProject(String fileName, IDictionary2 globalProperties, String toolsVersion)
於 OmniSharp.MSBuild.ProjectLoader.EvaluateProjectFileCore(String filePath, IReadOnlyDictionary2 projectConfigurationsInSolution, IList1 loggers) 於 D:\a\1\s\src\OmniSharp.MSBuild\ProjectLoader.cs: 行 160
於 OmniSharp.MSBuild.ProjectLoader.BuildProject(String filePath, IReadOnlyDictionary2 configurationsInSolution) 於 D:\a\1\s\src\OmniSharp.MSBuild\ProjectLoader.cs: 行 84 於 OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.Load(String filePath, ProjectIdInfo projectIdInfo, ProjectLoader loader, Guid sessionId, DotNetInfo dotNetInfo) 於 D:\a\1\s\src\OmniSharp.MSBuild\ProjectFile\ProjectFileInfo.cs: 行 117 於 OmniSharp.MSBuild.ProjectManager.<>c__DisplayClass32_0.<LoadProject>b__0() 於 D:\a\1\s\src\OmniSharp.MSBuild\ProjectManager.cs: 行 305 於 OmniSharp.MSBuild.ProjectManager.LoadOrReloadProject(String projectFilePath, Func1 loader) 於 D:\a\1\s\src\OmniSharp.MSBuild\ProjectManager.cs: 行 316
c:\TC\project\VES_Web\Working\Ves6WebSale\Ves6WebSale\Ves6WebSale.csproj(0,0)
System.MissingMethodException: 找不到方法: 'System.ReadOnlySpan1<Char> Microsoft.IO.Path.GetFileName(System.ReadOnlySpan1)'。
於 Microsoft.Build.Shared.FileMatcher.IsFileNameMatch(String path, String pattern)
於 System.Linq.Enumerable.WhereArrayIterator1.MoveNext() 於 System.Linq.Buffer1..ctor(IEnumerable1 source) 於 System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source)
於 Microsoft.Build.Shared.FileMatcher.GetFilesForStep(RecursiveStepResult stepResult, RecursionState recursionState, String projectDirectory, Boolean stripProjectDirectory)
於 Microsoft.Build.Shared.FileMatcher.GetFilesRecursive(ConcurrentStack1 listOfFiles, RecursionState recursionState, String projectDirectory, Boolean stripProjectDirectory, IList1 searchesToExclude, Dictionary2 searchesToExcludeInSubdirs, TaskOptions taskOptions) 於 Microsoft.Build.Shared.FileMatcher.GetFilesImplementation(String projectDirectoryUnescaped, String filespecUnescaped, List1 excludeSpecsUnescaped)
於 Microsoft.Build.Shared.FileMatcher.<>c__DisplayClass67_0.b__1(String _)
於 System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory)
於 Microsoft.Build.Shared.FileMatcher.GetFiles(String projectDirectoryUnescaped, String filespecUnescaped, List1 excludeSpecsUnescaped) 於 Microsoft.Build.Internal.EngineFileUtilities.GetFileList(String directoryEscaped, String filespecEscaped, Boolean returnEscaped, Boolean forceEvaluateWildCards, IEnumerable1 excludeSpecsEscaped, FileMatcher fileMatcher, Object loggingMechanism, IElementLocation includeLocation, IElementLocation excludeLocation, IElementLocation importLocation, BuildEventContext buildEventContext, String buildEventFileInfoFullPath, Boolean disableExcludeDriveEnumerationWarning)
於 Microsoft.Build.Internal.EngineFileUtilities.GetFileListEscaped(String directoryEscaped, String filespecEscaped, IEnumerable1 excludeSpecsEscaped, Boolean forceEvaluate, FileMatcher fileMatcher, Object loggingMechanism, IElementLocation includeLocation, IElementLocation excludeLocation, IElementLocation importLocation, BuildEventContext buildEventContext, String buildEventFileInfoFullPath, Boolean disableExcludeDriveEnumerationWarning) 於 Microsoft.Build.Evaluation.Evaluator4.ExpandAndLoadImportsFromUnescapedImportExpression(String directoryOfImportingFile, ProjectImportElement importElement, String unescapedExpression, Boolean throwOnFileNotExistsError, List1& imports) 於 Microsoft.Build.Evaluation.Evaluator4.ExpandAndLoadImportsFromUnescapedImportExpressionConditioned(String directoryOfImportingFile, ProjectImportElement importElement, List1& projects, SdkResult& sdkResult, Boolean throwOnFileNotExistsError) 於 Microsoft.Build.Evaluation.Evaluator4.ExpandAndLoadImports(String directoryOfImportingFile, ProjectImportElement importElement, SdkResult& sdkResult)
於 Microsoft.Build.Evaluation.Evaluator4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement) 於 Microsoft.Build.Evaluation.Evaluator4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
於 Microsoft.Build.Evaluation.Evaluator4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement) 於 Microsoft.Build.Evaluation.Evaluator4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
於 Microsoft.Build.Evaluation.Evaluator4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement) 於 Microsoft.Build.Evaluation.Evaluator4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
於 Microsoft.Build.Evaluation.Evaluator4.Evaluate() 於 Microsoft.Build.Evaluation.Evaluator4.Evaluate(IEvaluatorData4 data, Project project, ProjectRootElement root, ProjectLoadSettings loadSettings, Int32 maxNodeCount, PropertyDictionary1 environmentProperties, ILoggingService loggingService, IItemFactory2 itemFactory, IToolsetProvider toolsetProvider, ProjectRootElementCacheBase projectRootElementCache, BuildEventContext buildEventContext, ISdkResolverService sdkResolverService, Int32 submissionId, EvaluationContext evaluationContext, Boolean interactive) 於 Microsoft.Build.Evaluation.Project.ProjectImpl.Reevaluate(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext) 於 Microsoft.Build.Evaluation.Project.ProjectImpl.ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext) 於 Microsoft.Build.Evaluation.Project.ProjectImpl.ReevaluateIfNecessary(EvaluationContext evaluationContext) 於 Microsoft.Build.Evaluation.Project.ProjectImpl.Initialize(IDictionary2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
於 Microsoft.Build.Evaluation.Project..ctor(String projectFile, IDictionary2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext, IDirectoryCacheFactory directoryCacheFactory) 於 Microsoft.Build.Evaluation.ProjectCollection.LoadProject(String fileName, IDictionary2 globalProperties, String toolsVersion)
於 OmniSharp.MSBuild.ProjectLoader.EvaluateProjectFileCore(String filePath, IReadOnlyDictionary2 projectConfigurationsInSolution, IList1 loggers) 於 D:\a\1\s\src\OmniSharp.MSBuild\ProjectLoader.cs: 行 160
於 OmniSharp.MSBuild.ProjectLoader.BuildProject(String filePath, IReadOnlyDictionary2 configurationsInSolution) 於 D:\a\1\s\src\OmniSharp.MSBuild\ProjectLoader.cs: 行 84 於 OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.Load(String filePath, ProjectIdInfo projectIdInfo, ProjectLoader loader, Guid sessionId, DotNetInfo dotNetInfo) 於 D:\a\1\s\src\OmniSharp.MSBuild\ProjectFile\ProjectFileInfo.cs: 行 117 於 OmniSharp.MSBuild.ProjectManager.<>c__DisplayClass32_0.<LoadProject>b__0() 於 D:\a\1\s\src\OmniSharp.MSBuild\ProjectManager.cs: 行 305 於 OmniSharp.MSBuild.ProjectManager.LoadOrReloadProject(String projectFilePath, Func1 loader) 於 D:\a\1\s\src\OmniSharp.MSBuild\ProjectManager.cs: 行 316

Attempted to update project that is not loaded: c:\TC\project\VES_Web\Working\Ves6WebSale\Ves6WebSale\Ves6WebSale.csproj

@JoeRobich
Copy link
Member

We are running into this issue dotnet/msbuild#7873 (comment) and looks like Omnisharp-Roslyn needs to update the version of System.Memory they are referencing.

@Edemilorhea
Copy link
Author

@JoeRobich Yes, I having try it now, But My Web.config and WatchsoftAms.csproj their System.Memory all the 4.0.1.2 my nuget also is 4.5.5 version.

But it still happen "System.ReadOnlySpan1<Char> Microsoft.IO.Path.GetFileName(System.ReadOnlySpan1)'。"

@JoeRobich
Copy link
Member

@Edemilorhea Sorry, the issue is with the version of System.Memory that is referenced by the OmniSharp Language Server which powers the C# extension. Until it gets updated you will continue to see this issue when using newer builds of the VS Build Tools.

@Edemilorhea
Copy link
Author

@JoeRobich Oh I just need keep wait extension update?

@JoeRobich
Copy link
Member

JoeRobich commented Aug 26, 2022

Yes, I will look into updating OmniSharp-Roslyn this afternoon to fix this issue. Once it has updated you will be able to set your omnisharp.path to latest to pull in the rolling developer builds. I will comment back when a new build is available.

@JoeRobich
Copy link
Member

This will have to wait until next week. Will try to tackle it first thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants