dotnet / dotnet/msbuild

CMake created VS solution foldername conflicts with project/solution name

Open
#6,433 3 comments 0 reactions 0 assignees View on GitHub
Area: Solution (.sln) bug triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 13h
Merged PRs (30d)
133

Description

### Issue Description

If your cmake has `set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "{NAME}")` line, it creates a project folder in the solution list. However, the folder name must not be the same as any project's or solution's name. Otherwise it will cause ` Solution file error MSB5004: The solution file has two projects named "xxxx"`. For example your solution is named "GoodWork.sln", and in your cmake script, you have `set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "GoodWork/Test")` in any of the CMakeLists.txt, you will see this error.

### Expected Behavior
Build correctly.

### Actual Behavior

Error Solution file error MSB5004: The solution file has two projects named "xxxx"

### Analysis
It won't be a problem if you open the solution with VS and build it there. This project only occur using MSBuild in command line. So that factors out the issue from cmake.

### Versions & Configurations

Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.