question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

.Net Framework 4.6.1 omnicharp intellisense abd highlight broken.

See original GitHub issue

.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<Char>)’。 於 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.<GetFiles>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<Char>)’。 於 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.<GetFiles>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.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
JoeRobichcommented, 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.

0reactions
JoeRobichcommented, Aug 26, 2022

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - MacOS/VisualStudioCode/Omnisharp missing .NET ...
The issue seems to have stemmed from Omnisharp's decision to include mono internally. They default to that version of the compiler, ...
Read more >
Visual Studio Code Intellisense doesn't work with Unity 2018
Hello! I have this problem only with Unity 2018.2.0f2. I'm working on other projects in Unity 2017.4.5f1 and the problem does not exist ......
Read more >
NET Framework 4.6.1 Developer Pack - Microsoft Learn
This article describes the .NET Framework 4.6.1 Developer Pack and language packs. ... NET 4.6.1 SDK, and the language intelliSense.
Read more >
Fixing issues with building C# solutions in .NET Core using ...
If you want to build C# solutions in .NET Core using Visual Studio Code, you might come across these two issues.
Read more >
Bug listing with status RESOLVED with resolution OBSOLETE ...
... Keyboard map broken" status:RESOLVED resolution:OBSOLETE severity:major ... Bug:284881 - "net-zope/plone Prototype JavaScript framework Cross-Site AJAX ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found