-
Notifications
You must be signed in to change notification settings - Fork 783
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clear XmlDoc caches after closing a solution #138
Conversation
I'm sorry, but I'm not sure how the bug is any less severe with this PR applied? To build from command-line you'd still need to close the solution first, or get that jarring IO error. In any reasonably sized project, starting VS isn't what takes time, it is loading the solution that takes time. Now VS may have even more work to do, if the Xml doc cache needs to be recreated (not sure how the xml doc cache works). |
I think invalidating XmlDoc cache for each solution is an ok behaviour since two subsequent solutions might have very different sets of assembly references. You're right that opening a solution takes time. But immediately closing and re-opening a solution is fast enough (VS still keeps some caches). This is what the PR targets for. |
I'll have several instances of VS running at any given time, and never close a solution. I'll just close VS instead. This PR won't help this usage pattern. Also, manual action still needs to be taken to build from command line, whether it is close solution or close VS. Let's hope VS can stop locking these files instead. ;) |
Yes, I understand your point. I often get annoyed by this when using Paket to build solutions inside Visual Studio. Whenever Paket needs to update packages (including Xml files), Visual Studio locks these Xml files and builds fail. I have no way to recover from errors except closing VS. It happens because Paket is an external process while NuGet is integrated inside Visual Studio. /cc @forki |
From paket's and also FAKE's perspective there is really nothing we can do Yes, I understand your point. I often get annoyed by this when using Paket to build solutions inside /cc @forki https://github.com/forki — |
Have you confirmed this resolves the issue for the limited scenario of closing a solution? There is support for creating and closing solutions in the IDE unit tests, have you looked at adding a case? Even though it doesn't address the entire problem, this seems like a nice small improvement, and the delta looks innocent enough. I don't think closing and opening new solutions is a very common action, so even if there is a small perf hit here due to re-creating caches it doesn't strike me as particularly harmful. |
I have tested it with EnableOpenSource build.
Can you elaborate on what kind of tests you would like to add? The fact that Xml files are no longer locked is side effect; I'm not entirely sure how to write tests for it. |
Test would attempt the problem scenario:
This should be possible using existing IDE unit test infra (there is already nice support for creating slns/projects and checking intellisense), however it's probably overkill here... Unless someone objects, I guess I'm ok with not adding an explicit test. |
I also think that an integration test is overkill. I manually tested your scenario, (unfortunately) Xml doc files don't get locked inside VS 2015 with F# 4.0. Perhaps it needs other conditions for locking to happens. I tested with the following scenario:
|
Reference #57.
This PR makes sure that XmlDoc caches will be cleared when closing solutions. It helps release locks on Xml documentation files so that external clients can use these files.
As @latkin said in #57 (comment), the issue requires a fix in Visual Studio itself. The PR doesn't completely solve #57 but the bug should be less severe now.