-
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
[Bug]: Check for determining "project file" does not correctly work for solution filter files #9587
Comments
Also I think the "mock" code here msbuild/src/MSBuild.UnitTests/XMake_Tests.cs Lines 1931 to 1953 in 5d663a0
for this test does not correctly work msbuild/src/MSBuild.UnitTests/XMake_Tests.cs Lines 1614 to 1625 in 5d663a0
|
Team triage: @stefan-schweiger your analysis looks good, if you are interested, please send a PR fixing that. |
This bug has been fixed by Feature Request #10266 and PR #10794. The PR implemented the changes identified by @stefan-schweiger. I confirmed by testing and reviewing the code. I believe this issue can be closed. |
Thanks @jrdodds! |
Issue Description
When running
dotnet build
in a folder which only contains a.slnf
the commands won't work because no valid "project file" can be determined, but if you rundotnet build MyFilter.slnf
the commands correctly work.Steps to Reproduce
Create a solution with the following structure and run
dotnet build
in the folderServiceA
Expected Behavior
The build should correctly pick up the solution filter file and work like it would in the
/
andServiceA.QueryHandling
folders.Actual Behavior
If you run it in the
ServiceA
folder you get this error:MSB1003: Specify a project or solution file. The current working directory does not contain a project or solution file.
Analysis
I think the problem is on line 3422 here that it only looks for
*.sln
files and therefore never picks up*.slnf
files, so it should probably be changed to*.sln*
to actually correctly pick up the solution filter files.msbuild/src/MSBuild/XMake.cs
Lines 3422 to 3497 in 5d663a0
Versions & Configurations
MSBuild version 17.8.3+195e7f5a3 for .NET
17.8.3.51904%
dotnet 8.0.100
macOS 14.2.1 (23C71)
The text was updated successfully, but these errors were encountered: