Originally opened as https://github.com/aspnet/Mvc/issues/2997 by @varghesep
There is a serious performance problem with asp.net mvc 6 project running inside VS 2015.
To reproduce, keep the aspnet mvc 6 project open in the VS 2015. Then run a javascript package manager in the command line in the project folder. For example, I ran jspm install react. Then switch back to the VS 2015 from the command line, and you will see NOT RESPONDING message in the title of the VS 2015. It took at least 30 minutes or so for the VS 2015 to release the UI.
I assume VS 2015 was adding all the files from the jspm_packages folder to the project. This operation is required to add the files to the project. But I don't know why it should that long. I also experience VS 2015 not responding when browsing files in the solution folder.
My configuration:
Resharper is active
Adding @PradeepKadubandi and @BillHiebert
I had a suspicion on ReSharper add-on, but I see the same problem when ReSharper is in the suspended mode. I experienced more problems even during the editing of the files. If you want me to send you any log, please let me know.
I too have had this same exact issue of visual studio 15 hanging with a MVC 6 App and using jspm. For me, the workaround was NOT using the new project format, but using the older format ( with asp.net 4.5.2) which does not automatically include everything found in the directory. I could then make sure the jspm_packages directory does not get added to the project. By doing this, I was able to use visual studio normally.
The jspm_packages directory (along with the node_modules) ends up with 1250, and VS 15 simply cannot handle it with the new project system.
This is how my VS 2015 behave when a project is open. It will take at least 5-10 minutes to load a simple ASP.NET MVC6 project which has all the JSPM packages etc..
Have you tried excluding the jspm_packages and the lib folders? I will try that next.
Today I created a new ASP.NET MVC6 project by using the latest ASP.NET and Web Tools.
I deleted the LIB folder from the wwwroot folder. That did not help because the IDE added that folder back again. The Bower and NPM package folders under Dependencies is another area where things are slow during the initial project loading.
I don't think it has to do with jspm. Sure, more packages means more delay.
TFS #148752
I installed angular2 alpha39 in the wwwroot folder using the command jspm install npm:[email protected] npm:@reactivex/rxjs npm:reflect-metadata. Almost for 45 mins or so the Visual Studio UI was frozen.
Here is the screen shot:
are there any changes regarding this topic? I have the same problem where the IDE is useless because everything takes around 1 minute to complete. Even simple things like open a context menu of a file in the solution explorer.
I am also using jspm, npm, bower and gulp
The issue seems to be more general, related to numerous file changes. It's just that the package managers are commonly changing a large number of them. The issue is reproducible (frequently, although not consistently) provided you perform something effecting a large number of files in directory contained within the project, even if that folder is ignored using the new beta 8 tooling ability to hide the folders. Although I too am using jspm and npm along with alpha packages like angular2 and reactivex, I can cause Visual Studio to hang simply by running gulp tasks to compile several typescript files into a lib folder, which is hidden. The hanging behavior can also happen even when tasks are not run via Visual Studio but via command prompt, just make Visual Studio the active window after starting the task. It seems that some file watching behaviors are either causing unnecessary tasks and/or ones that are not fully decoupled from the UI thread.
Configuration notes:
We're seeing the exact same issue, and it's extremely frustrating, to the point where we're seriously considering just giving up on Visual Studio. This problem has been known for many months now, and it essentially makes Visual Studio completely useless for modern web development. I would really appreciate an answer as to whether this issue is being taken seriously and when we can expect it to be fixed, because the current silence and lack of improvement is not exactly encouraging.
Same here with VS2015 Enterprise and this wasn't fixed in Update 1.
jspm_packages
directory ignored in solution explorer and still completely unusable. From the Error List
, it looks like its still analysing the files even when its ignored in the solution...
Also, now that we are on the topic of useless tools, will you please fix the bug that causes the Solution Explorer for ASP.NET 5 projects to get out of sync with the file system all the time? This has also been a problem for months now, and it happens _very_ often when e.g. renaming, moving or deleting large folders - sometimes doing those things even crashes the project system, and if you don't unload the project, the whole IDE shortly after. I'm guessing this might be related to the performance issues...
I would like to report that the issue that I reported above now seems to be resolved.
This is what worked for me:
So, as far as I am concerned, this issue can be closed.
Momentary freezes are the issue. The sync issue reported by @thomas-darling was just brought up recently and should probably be a separate tracked issue.
I have updated to the latest VS and RC1, but still have the same momentary freezes that are extremely inconvenient.
I experience freezes for around 10 minutes when running gulp task to bundle a project in a new ASP.NET 5 RC1 template. Task Manager shows 3-5 instances of node.JS being spawned. VS and these instances together are eating almost 100% cpu while bundling and then it all goes back to normal. It's run on SSD and only 60% RAM is used. How to remedy this?
CPS team is working on investigation of this issue and having some problems with reproducing it. Can anyone here share a zipped solution so we have a consistent repro or share exact steps to repro it from scratch, please?
The issue that I faced can be reproduced by using JSPM package manager. Please follow Scott's article here. The next step is install more packages using JSPM in the _wwwroot_ folder. For example try jspm install angular. When the packages grow and more files gets added, you will see the performance problem.
@varghesep, same repro steps for me cause the same issue. I also use node packages, and running npm install causes the same issue. It appears to be related to any time many files are being added/deleted/changed. It _seems_ that VS might be trying to track all the file changes, and when a batch operation happens (such as what would happen with jspm or npm), VS get's hung up trying to figure out all the changes in the files (even if those files aren't tracked by version control).
I added the following to my xproj to hide the jspm folder and things got a little more usable for me:
<ItemGroup>
<DnxInvisibleFolder Include="wwwroot\jspm_packages\" />
</ItemGroup>
@dougludlow, does that keep VS from seeing when anything has changed inside that folder?
I think it just hides it from the view actually, I think VS still watches the files.
I happened upon this thread searching for answers for my similar issue, but in my case it's a large WPF project. If this is the same problem (sure sounds like it) I doubt it has anything specifically to do with web projects or tooling, but rather something more general (big projects?).
VS2015 Enterprise Update 1 - adding a new Project to my existing 3 Project Solution I see the VS IDE window title displaying "Not Responding" which is sign that the OS thinks the application has frozen or is not responding... UGH
PROTIP: don't try to exclude jspm_packages via the gui -- I found it easier to open my 500KB csproj file and remove all of the <Content Include="jspm_packages\..." />
lines by hand. I gave up waiting for VS 2015 after about twenty minutes and killed it.
I suspect this is the fix. At the very bottom of the page is a list of responsiveness fixes, including:
Using Visual Studio when a source controlled project path is too long
Once when I attached the debugger I was able to catch it blowing up on a long path name during the pause. Even when using npm 3+ many packages will still include deep node_modules paths.
Haven't tried the CTP yet though, my faith in the IDE has fallen very far. My guess is that it has little to do with the tooling and more to do with the IDE itself, which maybe is the reason for the loud silence for so long?
Using Visual Studio when a source controlled project path is too long
My issues are before I've even checked it into source control so I'd guess it hasn't fixed my issues.
Everybody keeps coming back to excluding directories and different means of achieving that but its quite obvious why that doesn't fix the issues entirely. For me, Visual Studio is still displaying hundreds of code syntax errors for files in those excluded directories so it clearly isn't excluding them completely!
It works, but freeeeeeeeeezes, if you try to move files around you get the famous "Not Responding", once you stup jspm, better not touch it anymore...not so productive with Visual Studio
I experience something similar using JSPM when trying to just create a angular 2 demo. I've even seen a programming blog post that says they started out in VS2015 but moved to VS Code because of the slow down. Don't know if this might somehow be related to typescript linting or what.
Same problem here! has anyone tried it with Visual Studio 2015 Update 2 RC version?
Tried it today, no luck, still freezing
Total lock up on my machine when using JSPM on VS Studio Enterprise w/ Update1. On the other hand, Visual Studio Code is buttery smooth.
Visual Studio Code is more like text editor.
Right now I can't call it "IDE".
But no other choices left =(.
Despite problems still prefer using full VS for backend part, just disabled node.js tools, added node/jspm_packages to every ignore I've found (project, git, Resharper), and not doing npm/jspm install while studio is open (or hard restart VS).
Hi all, thanks for your patience with this issue. We have made some improvements in VS 2015 Update 2 release (available now) that we expect will address this issue with VS freezing in ASP.NET 5 / ASP.NET Core projects.
If you can still reproduce with VS 2015 Update 2 RTW release as well, please let us know. Some simple steps to reproduce the problem starting with File > New Project would be really helpful as well.
Thanks,
Bala Chirtsabesan.
VS Web Tools team
it did not help. here's the solution that causes problems.
The only reprieve is to hide the folder from VS and re-sharper.
@balachir I don't remember having this issue with Update 1, but I installed Update 2 a few days ago. Today I moved the node_modules folder to the wwwroot folder (used to be in the project level). After doing this VS 2015 Update 2 crashes on startup. The error message I get is:
The project {MyProject} contains one or more files in folders that that are too long. These files will not appear in the project.
(note: the "that that" part is exactly what the message says -- typo)
After that I get a few more error messages saying which folders are too long and then the IDE crashes completely. I tried hiding that folder (DnxInvisibleFolder), but doesn't help with the error / crashing.
The folder path length is indeed 276 (greater than 260), but Windows Explorer doesn't seem to have a problem navigating to that path. Tried a few other programs and it worked fine. Looks like a VS specific problem.
Thanks for your patience with this issue. ASP.NET Core RC2 release is now available. With RC2 tooling, we now exclude node_modules anywhere under the project tree and not just under the project root folder. Similarly, jspm_packages folder is also excluded by default now. And I verified it with the Kibag.Forms project provided by @triarc that the VS freezing issue is not there anymore.
So the issues with VS freezing should be fixed now (at least partially) with the RC2 tooling. We still have work items active in our backlog to better handle exclusion of files from the project system and the perf issues that happen in VS when thousands of files are included under the project tree.
I'm going to go ahead and close this issue given the fix above. If you still have problems after installing RC2 tooling (such as long-path issue reported by @pebezo), please open a new issue and we can take a fresh look at your specific scenario.
Thanks!
What worked for me: Remove Microsoft Application Insights. This product was causing almost constant errors in Perflib and causing the application to hang with "Waiting for local host." Removing Application Insights solved the problem.
@balachir I experienced this issue early on, and it now is fully resolved for me. No slow or freezing with RC2 at all. Thank you so much!
For me, it hung when I removed .UseIISIntegration()
from the Main()
method in the WebHostBuilder()
for ASP.NET Core 1.0.1; Once I put UseIISIntegration()
back, using "start Debugging" worked again in Visual Studio 2015.
What @gortok describes is still an issue, filed #960 on this.