Skip to content
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

Mac version generates files with Windows newline #1240

Closed
livarcocc opened this issue Sep 15, 2017 · 3 comments
Closed

Mac version generates files with Windows newline #1240

livarcocc opened this issue Sep 15, 2017 · 3 comments

Comments

@livarcocc
Copy link
Contributor

From @kkpoon on September 15, 2017 1:17

it will mess up while the git enables autocrlf

Steps to reproduce

dotnet new sln

Expected behavior

a solution file with git friendly newline

Actual behavior

a solution file with windows newline

 Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2012
-Project("{f2a71f9b-5d33-465a-a702-920d77279786}") = "HelloService", "HelloService\HelloService.fsproj", "{35F4CAAD-FB1C-4904-8835-5E531737311E}"
+# Visual Studio 15^M
+VisualStudioVersion = 15.0.26124.0^M
+MinimumVisualStudioVersion = 15.0.26124.0^M
+Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "HelloService", "HelloService\HelloService.fsproj", "{B7559ADD-77E4-4914-9A35-F1ECD66A4985}"^M
 EndProject
 Global
        GlobalSection(SolutionConfigurationPlatforms) = preSolution
                Debug|Any CPU = Debug|Any CPU
+               Debug|x64 = Debug|x64^M
+               Debug|x86 = Debug|x86^M
                Release|Any CPU = Release|Any CPU
+               Release|x64 = Release|x64^M
+               Release|x86 = Release|x86^M
+       EndGlobalSection^M
+       GlobalSection(SolutionProperties) = preSolution^M
+               HideSolutionNode = FALSE^M
        EndGlobalSection
        GlobalSection(ProjectConfigurationPlatforms) = postSolution
-               {35F4CAAD-FB1C-4904-8835-5E531737311E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-               {35F4CAAD-FB1C-4904-8835-5E531737311E}.Debug|Any CPU.Build.0 = Debug|Any CPU
-               {35F4CAAD-FB1C-4904-8835-5E531737311E}.Release|Any CPU.ActiveCfg = Release|Any CPU
-               {35F4CAAD-FB1C-4904-8835-5E531737311E}.Release|Any CPU.Build.0 = Release|Any CPU
+               {B7559ADD-77E4-4914-9A35-F1ECD66A4985}.Debug|Any CPU.ActiveCfg = Debug|Any CPU^M
+               {B7559ADD-77E4-4914-9A35-F1ECD66A4985}.Debug|Any CPU.Build.0 = Debug|Any CPU^M
+               {B7559ADD-77E4-4914-9A35-F1ECD66A4985}.Debug|x64.ActiveCfg = Debug|x64^M
+               {B7559ADD-77E4-4914-9A35-F1ECD66A4985}.Debug|x64.Build.0 = Debug|x64^M
+               {B7559ADD-77E4-4914-9A35-F1ECD66A4985}.Debug|x86.ActiveCfg = Debug|x86^M
+               {B7559ADD-77E4-4914-9A35-F1ECD66A4985}.Debug|x86.Build.0 = Debug|x86^M
+               {B7559ADD-77E4-4914-9A35-F1ECD66A4985}.Release|Any CPU.ActiveCfg = Release|Any CPU^M
+               {B7559ADD-77E4-4914-9A35-F1ECD66A4985}.Release|Any CPU.Build.0 = Release|Any CPU^M
+               {B7559ADD-77E4-4914-9A35-F1ECD66A4985}.Release|x64.ActiveCfg = Release|x64^M
+               {B7559ADD-77E4-4914-9A35-F1ECD66A4985}.Release|x64.Build.0 = Release|x64^M
+               {B7559ADD-77E4-4914-9A35-F1ECD66A4985}.Release|x86.ActiveCfg = Release|x86^M
+               {B7559ADD-77E4-4914-9A35-F1ECD66A4985}.Release|x86.Build.0 = Release|x86^M
        EndGlobalSection
 EndGlobal

Environment data

dotnet --info output:

.NET Command Line Tools (2.0.0)

Product Information:
 Version:            2.0.0
 Commit SHA-1 hash:  cdcd1928c9

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.12
 OS Platform: Darwin
 RID:         osx.10.12-x64
 Base Path:   /usr/local/share/dotnet/sdk/2.0.0/

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.0
  Build    : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d

Copied from original issue: dotnet/cli#7661

@mlorbetske
Copy link
Contributor

@kkpoon it looks like the sln file is being modified (from the screenshot of the diff) - while new does carry content that has crlf line endings by default (more details in #1248), this particular case looks like a modification of the file - are you using a different dotnet command to modify the sln & that one is using crlf as well?

@kkpoon
Copy link

kkpoon commented Sep 23, 2017

My original sln file is generated by visual studio for mac.

I use dotnet command to generate the sln again to see the different of using visual studio and cli.

I am exploring the dotnet command to see whether our team could work on .net projects across OS and different developer preference. Some like IDE and some are CLI hero

@mlorbetske
Copy link
Contributor

Marking this as a duplicate of #1248

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

No branches or pull requests

3 participants