问题描述
我有两个相同的项目,正在使用.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
推荐答案
我将问题追溯到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在一个项目中无法正常运行,但在另一个项目中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!