-
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
Solution filter name as MSBuild variable #6162
Comments
Should be doable. There are only 11 lines with "SolutionName" in them, so probably just add SolutionFilterFileName under the relevant ones, and it'll show up as desired. Does that sound like the solution you want @rcmdh? |
Sounds great! |
@rcmdh, We decided to back this out, unfortunately. See #6325 (comment) |
@Forgind Could this be reconsidered? From the sound of it, sounds like it was backed out because you didn't have the user stories to support it. So I'll start: We have a solution filter that only opens the unit test projects. When opening project using this filter, I want to create a switch that uses nuget package references instead of project references, so that I can properly run my unit test with generated nuget packages, and also validate that these work correctly. The unit test projects won't even build when referencing the unloaded/filtered projects anyway, so naturally we do want to switch over. For example <ItemGroup Condition="'$(SolutionFilterName)'=='MySolutionFilter'">
<PackageReference Include="MyProject" Version="*" />
</ItemGroup>
<ItemGroup Condition="'$(SolutionFilterName)'!='MySolutionFilter'">
<ProjectReference Include="..\MyProject\MyProject.csproj" />
</ItemGroup> This makes it super easy for anyone to just open the test solution filter and run the unit tests with the latest build. Currently we do this with a manually set switch, but would be much easier and less error-prone to tie it to the filter. |
This ☝️ a million times |
I figured since this issue is closed, I'd create a feature request instead: |
Based on the comments, what we need is a concept of Build Profiles for solutions and Target Profiles for projects. 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, |
Is there an issue for Build/Target profiles? My usecase is very similar to the situation described in: #6162 (comment) |
We are starting to use new solution filters more, including in our build - they're great. We have some conditional elements in our project files dependent on which .sln is being built, can you add support for which .slnf is being built / processed? I had a look through available variables, but couldn't see any that looked like the current .slnf.
The text was updated successfully, but these errors were encountered: