-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Enable dotnet sln
to add SLN-level files
#9112
Comments
dotnet sdk
to add SLN-level filesdotnet sln
to add SLN-level files
I hope that I can do the follow thing with
|
I'd like to do what @John0King suggests: Be able to specify a "target solution directory" for anything I might add. Example commandlines I'd want:
Essentially controlling, both for projects and files, the target inside the solution file. If possible, the add command should also move existing projects within the solution (possibly by a
|
@richlander do you think this can be done as a community contribution? Edit: It seems pretty straight forward. The SlnFile supports adding/changing stuff, and there's a bunch of extensions on it to add projects, solution folders and more. |
cc @peterhuene who has been driving our community contributions. |
We currently have a related community PR to add an option to add the project to the "root" without any solution folders: dotnet/cli#10873 This is similar in intent to the issue, although I think adding another option for a "solution folder target" (a path) to create in the solution to add the project to would also be a great addition. I think this would be a great candidate for a community contribution. |
@peterhuene I've submitted a PR, dotnet/cli#11000 |
@peterhuene now that dotnet/cli#11000 is in, can we look at adding arbitrary files in solution files? :) |
@LordMike that's not a bad idea. Let me check with @KathleenDollard to see if the feature makes sense for our scenarios. |
I would argue that since you in VS can add any file as a solution-level file, you should be able to do this from the CLI as well. Concretely, we have a use case where we have a bunch of solution files in a single repository, each for a small partition of the overall product. To maintain these (we regularly add or remove projects), I've created a .NET program that reconstructs a project graph (follows imports and references) to add projects to solutions (by building a Although. This setup may be superseded by filtered solutions in VS2019. |
I really like aspects of this! Looks good, except the If we ever did the --allow-move, let's make it a different PR. |
@KathleenDollard what do you think about the ability to |
I think this makes more sense as a template. What would you put in it? |
Ah, no, My question is how you'd feel about the ability to add these extra files using the CLI.. ? :) |
I'd be a happy uer of the feature, being able to add all my build.props / targets and Directory.Build.props of various folder levels to a solution (including automatic solution folders) without dying of age using the VS UI. |
@peterhuene any new thoughts on this, or news from Camp Microsoft? :) |
Today I wanted to add YAML files to the Solution as part of Microservice Solution generation script. This feature would make that possible. |
In addition, you should be able to added such a file to a solution folder. It is very common to see a solution folder called something like "SolutionItems" with "config and readme" type files grouped into it. If you can do it in Visual Studio you should be able to do it in dotnet cli or you build in a feature gap that makes it hard for folks to move existing workflow from Visual Studio into a dotnet cli workflow. |
One of my contributions to
|
Thank you for the contribution and this works for projects just fine. However, it doesn't allow for a file to be added. It would be sweet if it did. |
Another vote for this. Having the ability to add existing files to the solution would be very useful. Even something a call for each separate file would work for me:
|
I'm going to close this one as a duplicate of #9611 because I've sketched out a spec for the functionality we'd want over there. The issue is marked up-for-grabs, but we may take another look at this later in the summer as we look at integrating the slnx file format support into the CLI's solution-management commands. |
I wasn't able to add SLN-level files to a
.sln
file with the commandline tools. VS enables me to do this.The text was updated successfully, but these errors were encountered: