resharper影响visual studio 2012内存占用吗

作者:赵青青 &&&&&& 出处:
我们不断地确保ReSharper的正常工作在现代硬件和中型和大型的解决方案,没有任何调整。
我们相信,Visual Studio的开发人员正在努力实现同样的事情,试图通过加快ReSharper的过时的硬件,你剥夺了强大的功能,可以加快你的开发表现自己。
如果您遇到与Visual Studio和ReSharper的性能问题,应用性能优化的列表。所给出的一些技巧是ReSharper的特定的,而另一些会VS性能,你是否已经安装了ReSharper的或没有影响。
为ReSharper加速
禁用代码分析当前文件
您可以按暂时禁用代码分析当前文件的Ctrl + Alt + Shift + 8。再次按下该快捷方式将重新启用的分析。你可以发现当前文件的状态指示灯代码分析的状态:
如果您要绑定一个不同的快捷方式进行此操作,寻找ReSharper_EnableDaemon命令。
禁用代码分析特定的文件
你可以告诉ReSharper的跳过分析某些文件,而无需打开它们。例如,你可以跳过包含行之有效的算法文件,不发生大的变化。要做到这一点,去&&ReSharper的|选项& ,然后选择&&代码检测|设置。点击编辑项目来跳过,并使用弹出的对话框中挑中的文件和文 件夹跳过。您也可以跳过指定的文件的文件掩码。最有可能的,你会发现,所有的文件,你禁用代码分析&&的Ctrl + Alt + Shift + 8已经在那里。
关闭解决方案范围的分析
在非常大的项目,打开可能会导致性能下降,特别是在那么强大的硬件。如果你觉得这个分析中占用太多的资源,只需将其关闭:右击西南铝圈在Visual Studio的右下角,选择分析解决方案错误或暂停解决方案。
一个对话框会弹出询问您是否要关闭SWA。说'是的',你就大功告成了。
禁用上下文行动
在ReSharper的选项,进入代码编辑|上下文操作和代码编辑| [语言] |上下文的动作,然后取消选中不那么对您有所帮助的行动。
如果您遇到减速打字时,你可以在关闭会员签名的ReSharper |选项|智能感知|完成外观:
如果这样没有帮助,切换到下内置在Visual Studio智能感知的ReSharper |选项|环境|智能感知|通用:
为了加快打字,你还可以禁用下自动格式选项的ReSharper |选项|环境|通用& ,以避免代码格式化打字时:
加快代码模板
为加快扩大代码模板,你可以关掉重新格式化,并缩短合格的参考,您使用的选项模板:
有关编辑代码模板的详细信息,请参阅&&。
禁止单元测试
如果你不使用ReSharper的单元测试运行,可以通过关闭它节省处理时间。去ReSharper的|选项|工具|单元测试,并明确了相应的复选框:
关闭导航栏
如果您使用的&&& 的窗口,那么你可能不使用导航栏上的编辑器的顶部。如果是这样,你可以通过取消选中相应的复选框以禁用工具|选项|文本编辑器| C#&。
如果没有帮助
如果你已经试过了上述的一切,表现仍下跌,你可以暂时禁用ReSharper的,并检查是否有放缓的原因。禁用/启用ReSharper的,到&&工具|选项| ReSharper的& ,点击&&暂停/恢复。
如果暂停ReSharper的有助于提高性能,但你还是要偶尔使用它的代码清理,格式化或分析,你可能想有一个快速切换ReSharper的开启和关闭的快捷方式。这里是如何做到这一点:&转到&&工具|选项|环境|键盘& 并找到ReSharper_ToggleSuspended命令,然后按一些快捷键,然后单击分配
已知的性能问题
以下是已知的性能问题及其相应的解决方案的列表。
VS2010有R#在Windows XP上缓慢
这个已知的问题可以通过安装Windows自动化API 3.0来解决。有关进一步详情,请参阅。请注意,此修补程序适用于Windows XP的只有-已经安装了Vista和Windows 7这个API。
ReSharper的升级后的性能下降
如果您最近更新的ReSharper的观察与被打开了与以前版本的解决方案,性能下降,你可以尝试通过清除ReSharper的缓存和删除解决方案,以加快事情了名为.suo文件。
要清除高速缓存,去ReSharper的|选项|环境|通用& ,点击清除缓存:
性能注意事项:& 储存在系统临时文件夹缓存可提供额外的好处,比如在项目的内容是通过Dropbox的或类似手段同步案件的能力。此外,性能可以的,如果你的系统临时文件夹映射到一个更快的存储介质,如高性能的固态硬盘或RAM盘得到改善。
已知的兼容性问题
其他Visual Studio扩展
主要的兼容性问题已经观察到了以下产品:
DevExpress CodeRush/Refactor Pro (incompatible)
Telerik JustCode (incompatible)
Whole Tomato Visual Assist
Productivity Power Tools
性能下降已经观察到了以下产品
Some versions of the StyleCop ReSharper plug-in
PowerCommands for Visual Studio
也有在网络精华促进低性能的同时,编辑.cshtml文件。如果你受到这个问题,可以考虑将工具|选项|网站要点和设置自动格式的HTML的输入为假。
的Parallels Desktop的Mac
如果你正在运行在Mac上使用的Parallels Desktop的Windows虚拟机的Visual Studio,ReSharper的智能感知列表可能会呈现很慢。
如果这种情况发生在你的设置中,考虑从相干模式切换到全屏模式。用于在两个模式之间进行切换的准则,请参阅。
改进Visual Studio的性能
开始调整的Visual Studio设置之前,请检查最新的Service Pack和修补程序的安装。
下面是相关链接:&
加快滚动编辑
用编辑器滚动的问题就出现了,由于硬件加速渲染的编辑器。如果您遇到这个问题,尝试下关闭下列选项&&工具|选项|环境|通用:
基于客户端性能自动调整视觉体验
使用硬件图形加速(如果可用)
节省时间启动
关闭起始页和新闻频道可能会节省一些时间启动。要做到这一点,到工具|选项|环境并选择开机时显示空环境。
干净的Web缓存
如果您使用的Web项目,Web缓存可能会放缓的Visual Studio。清理,删除下的一切%LOCALAPPDATA%\ MICROSOFT \ WebSiteCache。
禁用未使用的扩展
转到工具|扩展管理器,通过该列表,并检查是否真的需要它们。您可以卸载或禁用未使用的。
卸载未使用的项目
如果你不工作的一些项目,你可以从Visual Studio卸载他们,并在需要时重新加载他们。对项目或解决方案资源管理器解决方案文件夹,右键单击并选择卸载项目,或在解决方案文件夹卸载项目&-这将加快双方的Visual Studio和ReSharper的。顺便说一句,ReSharper的导航功能会更加的卸载项目。
禁用视觉XAML编辑器
在大型项目中,编辑XAML文件中可以感受到,即使在良好的硬件慢。如果你不使用可视化XAML编辑器,你可以部分通过禁用它解决问题。
要做到这一点,在Solution Explorer中的XAML文件单击鼠标右键,然后选择打开方式。在出现的对话框中,选择源代码(文本)编辑器,然后单击设为默认值。
或者,去工具|选项|文本编辑器| XAML |杂项,然后取消选择总是完全XAML视图中打开的文档。
英文出处:
作者:赵青青 &&&&&& 出处:
阅读(...) 评论()Since we are now long past the VS2015 beta, the specific issue I had back then is probably not relevant anymore. But it seems like this question is still getting quite a few hits a year after I posted it, so I will share some of the lessons learned since then in the hopes that it helps some people with similar issues. Problems with VS extensions and upgrades come in all sorts of flavors, after all.
The VS MEF Component Cache, located at %localappdata%\Microsoft\VisualStudio\14.0\ComponentModelCache can be a frequent source of problems with extensions.
Simply close VS and clear the folder. The cache will be automatically reconstructed when you start VS again. There's an extension which allows you to do this from the menu and this is typically one of the first things I try nowadays when I encounter any sort of issues in VS (and it helps quite often):
Deleting the bin and obj folders of your solution at the same time may help to rule out any inconsistencies in your build artifacts caused by a corrupted MEF component cache.
Update VS and your extensions.
As simple and obvious as it may seem, updates to Visual Studio and/or extensions might be one of the most frequently overlooked solutions to common problems.
Double check Tools -> Extensions and Updates -> Updated ->
Product Updates and Visual Studio Gallery to see if you have missed anything, and install any updates before you proceed with potentially wasting a lot of time.
Check for problems with your .NET framework installation
Microsoft has released a neat little tool for this and it has helped me solve an issue or two that occured after updating/installing different versions of the .NET framework in the wrong way:
Check for issues with Windows Update, PATH and/or the registry
This is especially true for machines that have not been reinstalled for a long time and been through some of the earlier builds of Windows 10 and DNX/DNVM. They may be the cause of a myriad of problems such as leaving invalid references to frameworks in your registry and/or PATH after product renames, as was the case with .NET 4.5.3 to .NET 4.6 and KRE to DNX.
In some cases a fresh install may just be the most time efficient way to solve most/all of these types of problems in one go. I for one reinstalled everything when VS2015 went out of BETA, to get rid of all the clutter from the frequent updates and changes.
While slightly out of scope of the question, in some cases the following sequence of commands may help to fix (or at least identify) common problems in Windows in general and consequently also in Visual Studio:
dism /online /cleanup-image /restorehealth (checks and, if necessary, fixes your Windows component store)
sfc /scannow (uses checksums to look for corruptions in core Windows dlls and registry keys)
They may not always be able to fix the problems they detect. That can be a signal of an underlying problem with the OS that might make it impossible to fix the problem with VS, if not tackled first.
Original question:
Since yesterday, my Visual Studio Test Explorer won't discover tests for any of my projects. It does not show the green loading bar after building, either.
When I go to the Visual Studio Test Explorer and click "Run All", or when I right-click any test method and select "Run Tests", I get the following in my output window:
Could not load file or assembly 'Microsoft.VisualStudio.Web.ProjectSystem, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
I am running Visual Studio 2015 CTP 6 on Windows 10 Pro Technical Preview, build 10041. The .NET Framework version does not seem to matter - it happens on 4.0, 4.5.2 and 4.6.
I tried with the following testing frameworks and all of them give the same behavior:
Microsoft.VisualStudio.QualityTools.UnitTestFramework v14.0.22609.0
xunit v2.1.0-beta1-build2945 with xunit.runner.visualstudio v2.1.0-beta1-build1051
NUnit v2.6.4 with NUnitTestAdapter v2.0.0
I find it rather curious that Google returns zero results on "Microsoft.VisualStudio.Web.ProjectSystem" (with the quotes).
I get a few hits on
but those articles all seem to be unrelated. Therefore I can't find any documentation on it, probably due to a discrepancy between the assembly and DLL name.
Question 1: Does anyone know (where to find information about) what this assembly does, where it's supposed to come from, and why it appears to be the culprit for discovering unit tests?
Now, it may (and probably does) have something to do with my attempt to build the ASP.NET and EntityFramework stack yesterday. I cloned the
(which includes the full stack) to my projects folder and ran build.cmd, as instructed by the readme. No errors besides a handful of login prompts for private repositories, which I manually canceled.
However, I couldn't open any of the AspNet solutions afterwards. I kept getting this error:
The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DNX\Microsoft.DNX.Props" was not found. Confirm that the path in the &Import& declaration is correct, and that the file exists on disk.
Googling for "Microsoft.DNX.Props" (with the quotes) gave me one result, pointing to an issue on GitHub:
It appears to be a known issue caused by a lot of renaming that Microsoft did recently. I decided to leave that for now and wait for CTP 7.
Question 2: Is it possible that the AspNet Universe build script caused the problem with my unit tests?
I found an issue on GitHub (xunit) that appeared to be similar: , with this comment from the xunit team:
Be aware that Visual Studio 2015 CTP 5 has been reported to be broken
by many people with unit testing in general (not just xUnit.net), so
don't expect that to work.
Also, please make sure you've cleaned out Visual Studio's runner
cache. If it gets corrupted, Visual Studio will permanently misbehave
until it's deleted. To clear the cache, shut down all instances of
Visual Studio, then delete the folder
%TEMP%\VisualStudioTestExplorerExtensions (honestly, it probably
wouldn't hurt to delete everything in %TEMP% that can be deleted).
Although I have CTP 6 instead of 5, I tried their suggestion to delete the folder "%TEMP%\VisualStudioTestExplorerExtensions". Unfortunately that did not fix the problem.
Furthermore, I noticed (by chance) that ReSharper actually is able to discover some tests. It only works for the VS and NUnit tests, not for xunit. I prefer not to use ReSharper for testing though. The Visual Studio Test Explorer has what I need and (to me at least) is a lot more intuitive.
Question 3: How come Visual Studio is not able to discover any tests, but ReSharper is?
There has to be some sort of temp or cache folder I need to clear, but I know Visual Studio has many of them and not all of them can be deleted without unwanted side-effects.
Due to the scarcity of information / search results on the errors I'm getting, I'm a bit at a loss on what to try or search for.
解决方案 All my unit tests are being discovered and run succesfully again.
I figured that clearing all cache and temp folder would be unlikely to cause problems which are more harmful than not being able to run any tests. So I cleared everything that even remotely looked like a Visual Studio-related temp or cache folder.
Since I did not have the time to go through everything one-by-one and then test in-between, I unfortunately don't know which one actually caused the problem.
The "solution"
I couldn't find a tool which already does this reliably, probably due to all the machine and version-specific paths that make it difficult to do so. Still, if anyone has a more efficient way to locate and clear/delete all temp/cache folders VS uses, I'd love to hear about it. You never know when VS decides to act up again.
These are all the steps I've taken:
Signed out of Visual Studio with my Microsoft account
Closed Visual Studio
Used CCleaner to clear system and browser temp files/folders
Manually cleared/deleted the following files/folders:
Folders under D:\Projects\... (this is where all my projects live)
All bin and obj folders (simple search)
The contents of the packages folders of the solutions I am working on
Folders under ...\AppData\Local\...
bower\cache
Microsoft\ApplicationInsights
Microsoft\UnitTest
Microsoft\VisualStudio\14.0\1033\SpecificFolderCache.xml
Microsoft\VisualStudio\14.0\1033\ProjectTemplateMRU.xml
Microsoft\VisualStudio\14.0\ComponentModelCache
Microsoft\VisualStudio\14.0\Designer\ShadowCache
Microsoft\VisualStudio\14.0\ImageLibrary\cache
Microsoft\VisualStudio Services\6.0\Cache
Microsoft\VSCommon\VSAccountManagement\AdalCache.cache
Microsoft\WebsiteCache
NuGet\Cache
Folders under ...\AppData\Roaming\...
AxTools\VS10x (CodeMap extension)
bower\cache
本文地址: &
由于我们现在早已过了VS2015测试版,我当时的具体问题是可能不再相关。但似乎这样的问题是仍然得到了一年了不少命中我张贴后,我将分享,因为当时的一些经验教训的希望,它可以帮助一些人有类似的问题。与VS扩展和升级的问题有各种的口味,毕竟。
的VS MEF组件缓存,位于%LOCALAPPDATA%\Microsoft\VisualStudio\14.0\ComponentModelCache 可与扩展问题的常见来源。
只需关闭VS并清除该文件夹。缓存会当你再次启动VS自动重建。这里有一个扩展,它可以让你从菜单中做到这一点,这是典型的第一件事我试试今天,当我遇到VS任何形式的问题之一(它可以帮助经常)的
删除斌和 OBJ 您在同一时间的解决方案的文件夹可以帮助以排除任何的不一致所造成的损坏MEF组件缓存构建文物。
更新VS和您的扩展。
由于操作简单,明显,因为它可能看起来,更新到Visual Studio和/或扩展可能是最经常被忽视的解决方案一常见的问题。 仔细检查工具
- > 扩展和更新
- > 产品更新和 Visual Studio库来看看你是否错过了什么,并安装任何更新在继续与潜在浪费了很多时间了。
检查与.NET Framework的安装
微软已经发布了这一个整洁的小工具,它帮助我解决更新/安装不同版本之后所发生的问题或两个。以错误的方式.NET框架:
检查与Windows的问题更新,路径和/或注册表
这尤其适用于那些没有被重新安装很长一段时间,并已通过一些机器早期版本的Windows 10和DNX / DNVM的。他们可能是无数的问题的原因,如留给框架无效引用您的注册表和/或路径产品重命名后,这一点与 .NET 4.5.3 到 .NET 4.6 和 KRE 到 DNX 。
在某些情况下,一个新的安装可能只是解决大多数/所有这些类型的问题一气呵成大部分时间有效的方式。一,我重新安装了一切,当VS2015出去BETA,要摆脱所有的杂波从频繁的更新和变化。
虽然稍微出了问题的范围,在某些情况下,下面的命令序列可帮助修复(或至少识别)在Windows一般在Visual Studio共同的问题,因而还
DISM /在线/清理图像/ restorehealth (检查,如果有必要,修复您的Windows组件店)
SFC / SCANNOW (使用校验方式来寻找核心的Windows DLL和注册表项损坏)
他们可能并不总是能够修复它们检测的问题。这可与OS潜在的问题可能使其无法与VS解决问题,如果不首先解决的一个信号。
从昨天开始,我的Visual Studio的测试资源管理器不会发现任何我的项目的测试。它没有显示建筑物,无论是后绿装吧。
当我去到Visual Studio测试资源管理器,然后单击“运行全部”,或当我右击任何测试方法并选择“运行测试”,我得到我的输出窗口中以下内容:
无法加载文件或程序集“Microsoft.VisualStudio .Web.ProjectSystem,版本= 14.0.0.0,文化=中性公钥= b03f5f7f11d50a3a'或它的一个依赖。该系统找不到指定的文件。
我在Windows 10 Pro的技术预览版运行Visual Studio 2015年CTP 6,建立10041.的。 NET Framework版本似乎并不重要 - 它发生在 4.0 , 4.5.2 和 4.6
我试着用下面的测试框架和他们都给出相同的行为:
Microsoft.VisualStudio.QualityTools.UnitTestFramework v14.0.22609.0
的xUnit V2.1.0-β1-build2945 与 xunit.runner.visualstudio V2.1.0-β1-build1051
NUnit的v2.6.4 与 NUnitTestAdapter V2.0.0
我觉得有点古怪,谷歌返回的的“Microsoft.VisualStudio.Web.ProjectSystem”(带引号)零的结果。
我得到的但这些条款似乎都无关。所以我找不到它的任何文件,可能是由于装配和DLL名称之间有差异。
问题1 :有谁知道(在哪里可以找到有关信息)本次大会做什么,在它从何而来,为什么它的出现的是为发现单元测试的罪魁祸首?
现在,它可能(也可能不会)有一些与我试图建立的ASP.NET和的EntityFramework堆栈昨天。我克隆了(其中包括完整的堆栈),以我的项目文件夹,然后跑了 build.cmd ,按照说明书记载的自述。除了登录一把没有错误提示为私有仓库,这是我手动取消。
不过,我无法打开任何ASPNET解决方案之后。我不断收到此错误:
中导入的项目“C:\Program文件(x86)\MSBuild\Microsoft\VisualStudio\\ \\v14.0\DNX\Microsoft.DNX.Props“没有被发现。确认在&lt路径;进口>声明是正确的,并且该文件存在于磁盘上。
谷歌搜索“Microsoft.DNX.Props”(带引号)给我一个结果,指着GitHub上的一个问题:,从球队的xUnit此评论:
注意的Visual Studio 2015年CTP 5已报道被许多人破相一般(不只是xUnit.net)单元测试,所以别不要指望,要工作。
另外,请确保您已经清理了Visual Studio的亚军缓存。如果被破坏,直到它删除Visual Studio将永久胡作非为。要清除高速缓存,关闭的Visual Studio的所有实例,然后删除该文件夹%TEMP%\VisualStudioTestExplorerExtensions(说实话,这大概不会伤害删除%TEMP一切%可以被删除)。
虽然我有CTP 6而不是5,我想他们的建议,删除文件夹“%TEMP %\VisualStudioTestExplorerExtensions“。遗憾的是没有解决的问题。
此外,我们注意到(偶然)的ReSharper的实际的是能发现一些测试。它仅适用于在VS和NUnit测试,不适合的xUnit。我不喜欢使用ReSharper的测试虽然。该Visual Studio的测试资源管理器有什么,我需要和(至少对我来说)是很多更直观
问3 :为什么视觉工作室是无法发现任何测试,但ReSharper的是什么?
必须有某种临时或我需要清除缓存文件夹中,但我知道的Visual Studio有很多的他们,而不是所有的人都可以在没有不必要的副作用被删除。
由于对我得到错误的信息/搜索结果的稀缺性,我位在什么尝试或搜索的损失。
解决方案 我所有的单元测试被发现,并成功地重新运行。
我计算过,清除所有缓存和临时文件夹是不太可能导致这比不能够运行任何测试更有害的问题。所以我被清除,即使是远程看起来像一个Visual Studio相关的临时或缓存文件夹中的一切。
由于我没有足够的时间去通过一切一个接一个然后测试在两者之间,我遗憾的是不知道哪一个实际导致的问题。
的“解决方案”
我无法找到一个工具,它已经这样做可靠,可能是由于所有的机器和特定版本的路径,使得它很难做到这一点。不过,如果任何人有一个更有效的方法来查找和清除/删除所有临时/缓存文件夹VS用途,我很想听到。你永远不知道什么时候VS决定再次行动起来。
这些都是我所采取的步骤:
已退出的Visual Studio与我的Microsoft帐户
关闭Visual Studio中
用于CCleaner的清除系统和浏览器温度文件/文件夹
手动清除/删除以下文件/文件夹:
$ \Projects\ ... (这是我所有的项目居住的地方) $ b:在 D b
$ b 文件夹 $ b
所有斌和 OBJ 文件夹(简单搜索)
的包的内容我在
工作方案的文件夹
在 ... \AppData\Local\ ...
$ b文件夹$ b
bower\cache
微软\ApplicationInsights
Microsoft\UnitTest
Microsoft\VisualStudio\14.0\1033\SpecificFolderCache.xml
Microsoft\VisualStudio\ 14.0\1033\ProjectTemplateMRU.xml
Microsoft\VisualStudio\14.0\ComponentModelCache
Microsoft\VisualStudio\14.0\Designer\ShadowCache
Microsoft\VisualStudio\14.0\ImageLibrary\cache
Microsoft\VisualStudio Services\6.0\\ \\Cache
Microsoft\VSCommon\VSAccountManagement\AdalCache.cache
Microsoft\WebsiteCache
NuGet\Cache
文件夹在 ... \AppData\Roaming\ ...
AxTools\VS10x (编码映射扩展)
bower\cache
本文地址: &
扫一扫关注官方微信

我要回帖

更多关于 visual studio 2012 的文章

 

随机推荐