-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[Feature Request]: Solution Filters for target frameworks as well as projects #9159
Comments
What we need is a concept of Build Profiles for solutions and Target Profiles for projects. This should solve the problem of custom builds. But first we need to have a MSBuild native solution file format. Solution files are a concept tied to VS IDE only right now! They are verbose and not human friendly. There's an issue open, requesting to modernize the solution file. |
Then again, |
@Nirmal4G Is that open issue in a public place where comments and votes can be added in support of the request? |
Please file desired features for |
I'm using solution filters with Jetbrains Rider myself... And on our CI servers we're running builds against solution filters just using dotnet build. So I'm not sure how the visual studio team could implement this. It needs support in msbuild right? |
Like the |
Understood, thanks @rainersigwald ! |
Summary
Solution filters would allow us to configure
Background and Motivation
Currently we have multiple solution files in our repository. One of these exists mainly to enable us to set some flags in the
Directory.Build.props
, which get used later on to determine which frameworks to target.Maintaining multiple solution files in a large project is a pain though. Ideally we'd have one solution file that contained all of the projects in the repository and we would have multiple solution filters.
Solution filters would allow us to configure
So this is not a case of changing the build behaviour... it's just being able to filter the builds down to a more granular level than by project (we want to filter by target framework as well).
Proposed Feature
There are lots of possible designs. Picking the first one that comes to mind (not always the best):
*.slnf
files could have a<TargetFrameworksFilter>
property*.csproj
) could use that to filter the frameworks they targetFor example, imagine a solution filter
My.slnf
:And the following snippet in the
My.csproj
:When buliding
My.csproj
ordinarily, builds would be created for all 6 of the target frameworks. However when buildingMy.slnf
, builds would only be created fornet6.0
andnet5.0
.Alternative Designs
Currently you can add conditions based on the solution name like:
If it was possible to add conditions based on the solution filter name as well, then that would also provide a way of changing target frameworks based on the solution filter being applied:
That would be a more flexible solution, but then it might also give you enough rope to hang yourself.
The text was updated successfully, but these errors were encountered: