Open erik-kallen opened 8 years ago
@mattwar or @jasonmalinowski Can you answer this?
The file tracking logic was removed because it didn't fit the usage scenarios for MSBuildWorkspace, which is intended for simple analysis or transformation command line tools, not for live edit sessions like with VS editor.
So is there a better workspace for my use case? Or, if not, is there any way to reload a single project?
There's nothing better, no.
In that case, please consider this a feature request for a feature that allows for just a single project to be reloaded
Hi, bit late the party, just ran into this issue myself. @erik-kallen did you ever find a way to resolve question 2? I have a use case where i need to process a project using CodeAnalysis with some additional changes to the csproj files externally. I'd like to reload just the project instead of reloading the whole solution.
Thanks in advance :)
@fred-perkins No, I did not. I had to resort to reloading the entire solution when a project file changed
@mattwar @jasonmalinowki so how does Visual Studio / VSCode live-monitor changes in files? Is there any alternative we can pursue for quickly monitoring and live-analyzing a C# project/solution?
@mattwar @jasonmalinowki so how does Visual Studio / VSCode live-monitor changes in files? Is there any alternative we can pursue for quickly monitoring and live-analyzing a C# project/solution?
We don't use MSBuildWorkspace for this. We use VisualStudioWorkspace. This type hooks in appropriately to VS (including their own directory/file watching facilities).
@jmarolf Is this covered by your PR https://github.com/dotnet/roslyn/pull/52554
PR has been rejected. Are there any plans to support it?
We're going to be needing to implement this (or something like it) soon, so we'll see what that ultimately looks like.
Hi, any progress on this? What do you mean by saying "soon"?
I need to monitor a solution for changes. I do this by opening the solution using
MSBuildWorkspace.Create().OpenSolutionAsync(solutionPath)
. I then start aFileSystemWatcher
that watches all files in the solution, and whenever I detect a file to a .cs file, I useI have two questions:
solution.GetDocumentIdsWithFilePath()
returns nothing for those files. Ideally I want to reload the project that changed, and only that project, when this happens. How can I do this?