Skip to content

Conversation

hohosznta
Copy link

Description and customer impact

Fixes #47859

This ensures that Solution Folders do not allow adding a project that shares the same filename, regardless of its path. Before, adding the project to the solution using dotnet commands succeeded without errors, but building or opening it in Visual Studio produced errors or warnings. Now, it shows an error when adding duplicate filenames to solution folder via dotnet commands.
The existing test was originally intended to verify this behavior but had been skipped. I have now unskipped it.

Copy link
Contributor

github-actions bot commented Oct 5, 2025

This PR is targeting main, which is now for .NET 11-facing work. If you intended to target .NET 10, either retarget this PR to release/10.0.1xx or make sure you backport the change to release/10.0.1xx after merging. See #50394 for more details.

@hohosznta
Copy link
Author

I added a new CliString error message SolutionFolderAlreadyContainsProjectWithFilename since previously it didn't have a error ccase with solution folder, but it seems like it needs to be translated into various languages. Should I just use SolutionAlreadyContainsProject cliString?

Copy link
Member

@MiYanni MiYanni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

Edit: You need to agree to the license/cla check for us to merge the code changes.

@MiYanni
Copy link
Member

MiYanni commented Oct 7, 2025

I added a new CliString error message SolutionFolderAlreadyContainsProjectWithFilename since previously it didn't have a error ccase with solution folder, but it seems like it needs to be translated into various languages. Should I just use SolutionAlreadyContainsProject cliString?

It is fine to add a new string. Our translation team will handle it just fine.

@hohosznta
Copy link
Author

@dotnet-policy-service agree

@hohosznta
Copy link
Author

Thanks, I have now agreed to the license. @MiYanni

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Should Throw Error When Adding Projects with the Same Name but Different Paths to Solution Folder
2 participants