OmniSharp在一个项目中无法正常运行,但在另一个项目中 [英] OmniSharp not functioning properly in one project but is in another

查看:506
本文介绍了OmniSharp在一个项目中无法正常运行,但在另一个项目中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个相同的项目,正在使用.NET Core JSON API创建完整的Ember Web-ui堆栈.我注意到在一个项目中,OmniSharp没有提供include using语句,但是在另一个项目中却提供了.此外,对于OmniSharp不提供include using语句的项目,OmniSharp确实提供了remove unused usings的选项.当我选择此选项时,它将删除除两个using语句之外的所有语句,这是不正确的,因为现在无法构建该应用程序.

I have two identical projects that I am using to create a full stack Ember web-ui with .NET Core JSON API. I notice that in one project, OmniSharp is not providing the include using statement, but it does in the other project. Additionally, for the project where OmniSharp does not provide the include using statement, OmniSharp does provide an option to remove unused usings. When I select this option, it removes all but two using statements, which is incorrect because now the application will not build.

我尝试卸载VSCode并删除C:\windows\users路径中的.vscode文件夹,其中包含已安装的扩展名,以及删除所有临时文件.但是,这不能解决问题.

I tried uninstalling VSCode and deleting the .vscode folder in the C:\windows\users path, which contains the installed extensions, as well as deleting all temp files. However, this does not solve the problem.

考虑到OmniSharp在一个项目中起作用,而不是在另一个项目中起作用,那么我在这一点上唯一想到的就是OmniSharp是在项目级别配置的,或者给定项目中存在损坏.有没有人遇到过这个问题?关于如何解决/解决此问题的任何想法?

Considering that OmniSharp works in one project, but not the other, then the only thing that I can think of at this point is that either OmniSharp is configured at the project level or there is a corruption in the given project. Has anyone ever experienced this problem? Any ideas on how I can address/fix this?

注意:我不希望删除OmniSharp无法使用的项目,因为重建它大约需要一周的时间.

Note: I would hate to delete the project that OmniSharp does not work in because it would take about a week to rebuild it.

更新:

经过进一步研究,我在OmniSharp日志中发现以下错误

After additional research, I found the following error in the OmniSharp Log

项目系统'OmniSharp.Script.ScriptProjectSystem'被抛出 初始化期间发生异常. System.IO.DirectoryNotFoundException: 找不到路径的一部分 'd:... \ tmp \ broccoli_merge_trees-input_base_path-YLNtHXfX.tmp \ 1-private'.在System.IO .__ Error.WinIOError(Int32 errorCode,可能是StringFullPath) 在System.IO.FileSystemEnumerableIterator 1.CommonInit() at System.IO.FileSystemEnumerableIterator 1..ctor(字符串路径,字符串 originalUserPath,字符串searchPattern,SearchOption searchOption, SearchResultHandler 1 resultHandler, Boolean checkHost) at System.IO.DirectoryInfo.EnumerateFileSystemInfos(String searchPattern, SearchOption searchOption) at Microsoft.Extensions.FileSystemGlobbing.Abstractions.DirectoryInfoWrapper.<EnumerateFileSystemInfos>d__4.MoveNext() at System.Collections.Generic.List 1.InsertRange(Int32索引, IEnumerable`1 collection)at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase 目录,字符串parentRelativePath)位于 Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase 目录,字符串parentRelativePath)位于 Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase 目录,字符串parentRelativePath)位于 Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase 目录,字符串parentRelativePath)位于 Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase 目录,字符串parentRelativePath)位于 Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase 目录,字符串parentRelativePath)位于 Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Execute() 在 Microsoft.Extensions.FileSystemGlobbing.MatcherExtensions.GetResultsInFullPath(Matcher 匹配器,String directoryPath)位于 OmniSharp.Script.ScriptProjectSystem.Initalize(IConfiguration 配置) OmniSharp.WorkspaceInitializer.Initialize(IServiceProvider serviceProvider,CompositionHost compositionHost)

The project system 'OmniSharp.Script.ScriptProjectSystem' threw exception during initialization. System.IO.DirectoryNotFoundException: Could not find a part of the path 'd:...\tmp\broccoli_merge_trees-input_base_path-YLNtHXfX.tmp\1-private'. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileSystemEnumerableIterator1.CommonInit() at System.IO.FileSystemEnumerableIterator1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler1 resultHandler, Boolean checkHost) at System.IO.DirectoryInfo.EnumerateFileSystemInfos(String searchPattern, SearchOption searchOption) at Microsoft.Extensions.FileSystemGlobbing.Abstractions.DirectoryInfoWrapper.<EnumerateFileSystemInfos>d__4.MoveNext() at System.Collections.Generic.List1.InsertRange(Int32 index, IEnumerable`1 collection) at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath) at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath) at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath) at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath) at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath) at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath) at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Execute() at Microsoft.Extensions.FileSystemGlobbing.MatcherExtensions.GetResultsInFullPath(Matcher matcher, String directoryPath) at OmniSharp.Script.ScriptProjectSystem.Initalize(IConfiguration configuration) at OmniSharp.WorkspaceInitializer.Initialize(IServiceProvider serviceProvider, CompositionHost compositionHost)

推荐答案

我将问题追溯到Ember项目中的tmp文件夹,其中充满了损坏的文件和文件夹.我安装了附加的Ember clean-tmp并运行了它.清除tmp文件夹后,我重新启动VSCode并检查了OmniSharp日志,并且异常错误消失了.因此,OmniSharp Using语句开始在agian中工作.

I traced the problem to the tmp folder in the Ember project filling up with files and folders that became broken. I installed the add-on Ember clean-tmp and ran that. Once the tmp folder was cleaned, I restarted VSCode and checked the OmniSharp Log and the exception errors went away. Consequently, the OmniSharp Using statement started working agian.

故事的寓意:关注该tmp文件夹!

Moral of the story: keep an eye on that tmp folder!

https://www.npmjs.com/package/ember-clean-tmp

这篇关于OmniSharp在一个项目中无法正常运行,但在另一个项目中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆