1

Environment

I use Visual Studio 2012 with ReSharper 7.
The issue occurs when I develop website.
I don't develop website in local IIS, but in local-network: they are in local-server, I open they in shared folder, example \\my-server\InetWeb\Domains\acme.com\www_v1.

My issue

When I work with .cshtml file I have not issues.
But when I save a .cs file in App_Code folder and go to another .cs file in App_Code folder, Visual Studio UI don't works, it is freezed for 12 seconds!!.
Same issue when I create new file in App_Code, or when I rename Class, move file, from/to this folder.

If I suspend ReSharper, Visual Studio works faster, always.

How can I resolve it?

Yesterday I tested ReSharper 8: I have the same issue.

riofly
  • 1,694
  • 3
  • 19
  • 40

2 Answers2

0

The issue is simply that R# is fairly slow to update it's database. The database is typically under the name: SolutionName\_ReSharper.SolutionName

The solution can simply be to use another folder to set the R# cache.

Community
  • 1
  • 1
Ciprian Khlud
  • 434
  • 3
  • 6
  • I have tried to change cache folder, but the change does not bring improvements. I tried to copy web site to **local folder** also: this change reduce the time from 12-14 seconds to **4-5 seconds**. – riofly Sep 20 '13 at 07:36
  • Go to Task Manager (Control+Shift+Escape)> Performance Tab> Resource Monitor and go to Disk, Network and CPU. Can you say which of them is having heavy usage on your configuration? – Ciprian Khlud Sep 20 '13 at 07:39
  • Then you may try for going to: Resharper => Options => Code Inspection =>Settings => Edit Items to Skip and remove for now cshtml files so maybe they will remove the freezeup. I tried to do a project over the network share and it worked a bit slow, but it was fast enough as for me. I had occasional 1-2 seconds breaks but after moving cache to temp I get like 0.2-0.5 seconds (like micro-shutters) but is still ok to write against. I looked with Task manager, and it transfers like for every save around 1.5 MB over the wire. So speed up the network share may fix the issue. – Ciprian Khlud Sep 20 '13 at 08:00
  • Wow... I haven't think to look HD activity... Then: 1) save file, time 0.00; 2) look HD activity: starts MsMpEng.exe, devenv.exe, aspnet_compiler.exe, Microsoft.VisualStudio.Web.Host.exe; 3) time 0.15, UI works; 4) time 0.45, any newest HD activity ends. – riofly Sep 20 '13 at 08:08
  • I tried to set `Edit items to Skip`: root folder of website. Nothing... 14-15 seconds. – riofly Sep 20 '13 at 08:15
  • So, maybe R# is the part of 0.15 to 0.45 part where it does redo it's types. When you move over the network share, all these costs are bigger as network share is slower than disk and cannot be cached by the OS's disk cache. If you can talk with your network admin, maybe make sure that you are using SMB 2.0 for shares. It looks to be faster: http://www.tomshardware.com/reviews/WINDOWS-SERVER-2008-REVIEWED,1710-8.html – Ciprian Khlud Sep 20 '13 at 08:20
  • I use Windows 8 64bit, and the server is Windows Server 2008 32bit. I think that SMBv2 is already on... Is it true? – riofly Sep 20 '13 at 08:28
  • Yes, it is true (about SMB 2.0) – Ciprian Khlud Sep 20 '13 at 08:34
  • Yes, I checked, the version used in InetWeb folder is 2.02. I open an Issue to ReSharper track... Thanks Ciprian – riofly Sep 20 '13 at 08:36
0

I resolved the issue. The freeze time go down to 2 seconds or less.

Previously I open project through shared folder in local server.

I tested to open project through FTP access: I look that the freeze time is done but I have new performance issues.

I resolved the issue using WebDAV protocol:

  • add WebDAV application in "default website" on the IIS server. This application allows me to access to the root folder of my websites.
  • in server, open "C:\Windows\System32\inetsrv\config\applicationHost.config", add allowSubDirConfig="false" attribute:



<configuration>
 <system.applicationHost>
  <sites>
   <site name="Default Web Site">
    <application path="/WebDAV">
     <virtualDirectory path="/" physicalPath="C:\inetpub\wwwroot\WebDAV" logonMethod="Network" />
     <virtualDirectory path="/WWW" physicalPath="C:\MyProjects" logonMethod="Network" allowSubDirConfig="false" />
    </application>
   </site>
  </sites>
 </system.applicationHost>
</configuration>

  • in the same file, set applyToWebDAV attribute to "false":



<configuration>
 <system.webServer>
  <security>
   <requestFiltering>
    <fileExtensions ... applyToWebDAV="false">
     ...
    </fileExtensions>
   </requestFiltering>
  </security>
 </system.webServer>
</configuration>

  • in local PC add connection to WebDAV folder.
  • in VisualStudio open existing website through WebDAV folder.

Attenction
this solution is not perfect:

  • I can't run debug of hosted website
  • I can't edit web.config files
riofly
  • 1,694
  • 3
  • 19
  • 40