-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Slnf files #21745
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
Slnf files #21745
Conversation
@@ -0,0 +1,132 @@ | |||
{ | |||
"solution": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've been using slnf files in Blazor and MVC for a while now and personally I have been fairly happy with it.
In Mvc, we've had a smaller projection of project files that specifically include projects in the Mvc folder: https://github.com/dotnet/aspnetcore/blob/master/src/Mvc/MvcNoDeps.slnf. The big issue with a smaller projection is that VS expects referenced projects to have already been built. You'll get weird errors from MSBuild if referenced projects weren't already built. Usually I run a build[cmd|sh]
on the cli before I launch a slnf and all's well with the world. On the upside, smaller projections have a much faster dev inner-loop. On projects like MVC or Blazor which reference nearly everything in the repo, this makes a big difference.
Going back to slnf files, there are a couple of annoying usage issues with it.
- Adding additional projects to an slnf file isn't as simple as using the
Add Existing Project
dialog. I've typically ended up hand-editing it (not difficult since it's just JSON). - CLI commands such as
dotnet build
\dotnet restore
etc do not work on slnf files, unlike sln files - VS sometimes does not add slnf files to it's recently used project history. This one was aggravating enough that I filed a feedback issue - https://developercommunity.visualstudio.com/content/problem/660100/slnf-do-not-get-added-to-the-recent-projects-and-s.html.
As an aside, were you able to open the AspNetCore.sln file on a laptop? This was a while back, but I remember trying to build a large sln and it would take VS minutes before the UI became usable. It's rare you would want to open the root-level sln file, but it would be good to ensure it's not entirely unusable if you needed to open it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was able to open it on my home desktop (which is an 16-proc Xeon with 32GB of RAM). It wasn't pleasant until all the design time builds had run and been cached in the .vs
folder, but after that it wasn't bad at all.
I haven't tried on my SurfaceBook 2 yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding additional projects to an slnf file isn't as simple as using the
Add Existing Project
dialog.
Does this apply to creating new projects as well. For example, will devs need to add a project to AspNetCore.sln then hand edit the relevant *.slnf files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a project to a slnf file adds it to the backing sln. But I couldn't figure out what the gesture was to update the slnf file too while it was doing so.
Note: This is just a proposal to discuss at @dotnet/aspdoi. If people don't want this experience, we don't have to use it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks awesome to me but I'd like to hear from a couple of people who check out this branch and use it for their normal work (before cherry-picking changes into a branch targeting 'master').
Oops, if we do move forward with this (please 😃), I didn't look through the failures enough to see if we have other tests that depend on where a *.sln file is located. |
For those who stumbled into this PR (like me): https://docs.microsoft.com/en-us/visualstudio/ide/filtered-solutions?view=vs-2019 Looks very useful. SLNF all the things! 🏆 |
These are my findings based on looking playing with it:
CONS:
OBSERVATIONS:
|
Wish I had merged this before @pranavkm re-added the blazor wasm stuff :( |
Okay, I basically redid the work here against a current version of the master branch. I think this is ready for review now. A couple of things I've learned:
|
I wonder if we'll end up seeing a lot of merge conflicts on the global Was the |
Yes, it might be nice to have the script in the repo so that we can discard changes and re-run when dealing with merge conflicts. |
Happy to share, but the way it's written right now, it will break once this is merged - it goes looking for all existing Once the existing |
Then again, it should reasonable to write a script that traverses the repo and adds everything it finds to the solution using We already traverse the project files (to confirm their names are unique) in eng/scripts/CodeGen.ps1. That script also uses |
The exceptions are the problem there - currently there are about 150 *proj files that aren't in the sln (though I'm not sure if some/all/most/ should be). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good so far but doesn't change the startvs.cmd files yet. In addition, should probably change the dotnet sln
example in docs\BuildFromSource.md to mention AspNetCore.sln and the various *.slnf
files.
Hmm. I did change the startvs.cmd files locally, must need to push again. Need to fix some tests, and will update BuildFromSource.md as well. |
Agreed @Pilchie. In addition, the Code Check job is failing because a few of the Blazor projects no longer exist. |
Closing in favor of #23581 :( Not sure why pushing here isn't working. |
No description provided.