Visual Studio modifies solution files created from the dotnet CLI.
See original GitHub issueSteps to reproduce
mkdir test
cd test
dotnet new sln
dotnet new console -o console
dotnet sln add .\console\console.csproj
# commit to git repo before opening in VS
open the solution with Visual Studio (version info below), open diff of test.sln:
Expected behavior
I would assume Visual Studio would leave the file alone. Or, the template from dotnet new sln
should conform with what Visual Studio expects.
Actual behavior
Visual Studio makes many changes, see above.
Environment data
dotnet --info
output:
.NET Command Line Tools (1.0.1)
Product Information: Version: 1.0.1 Commit SHA-1 hash: 005db40cd1
Runtime Environment: OS Name: Windows OS Version: 10.0.14393 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\1.0.1
System info:
Visual Studio info:
Microsoft Visual Studio Community 2017 Version 15.0.26228.12 D15RTWSVC Microsoft .NET Framework Version 4.6.01586
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:9 (6 by maintainers)
Top Results From Across the Web
dotnet sln command - .NET CLI
The dotnet sln command provides a convenient way to list and modify projects in a solution file. Create a solution file. To use...
Read more >Creating and editing solution files with the .NET CLI
In this post, I show how to manage sln files with the .NET command line interface (CLI). See how to create sln files,...
Read more >How to prevent Visual Studio from changing the solution ...
I found a solution. 2 files must be changed: Subject/Subject.csproj. This change is necessary because this file is a contrived example of a ......
Read more >Manage and Edit soluton files with visual studio code ...
Let's take a look at creating Visual Studio Solution Files in .net Core, using the Command Line Interface (CLI).
Read more >Creating a solution file and adding projects in it
Creating a solution file and adding projects in it Using the .NET Core CLI, you can also create a solution file and add/remove...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi, I have strange issue similar to this. I am writing F# on dotnet core on macOS. When I create console app and add it to solution using CLI, project is added with F2A71F9B-5D33-465A-A702-920D77279786 GUID. The same happens if I try to add project to the solution using VS for mac. With both approaches build works as expected.
However, when solution is opened on Windows 10 using VS 15.3, project GUIDs are being changed to 6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705 and everything works on Windows machine. When I move back to Mac and try to open the same solution it won’t compile until GUID is reverted to F2A71F9B-5D33-465A-A702-920D77279786. Alternatively it will compile if I keep 6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705 project GUID but then I have to change backslashes "" with slashes “/” in the project path!!! 🤓
Since we are using different platforms (Mac and Windows) to work on the same solution this issue causes a lot of pain.
@peterhuene Thank you for the reply, I’m sorry, I didn’t pay attention to the milestone of this issue.