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

Lineendings of a new *.wixproj #5714

Open
andorz opened this Issue Oct 28, 2017 · 3 comments

Comments

Projects
None yet
3 participants
@andorz

andorz commented Oct 28, 2017

  • Which version of WiX are you building with?
    3.11.0.1701

  • Which version of Visual Studio are you building with (if any)?
    Visual Studio Community 2017 - 15.4.1

  • Which version of the WiX Toolset Visual Studio Extension are you building with (if any)?
    0.9.21.62588

  • Which version of .NET are you building with?
    4.7

  • Describe the problem and the steps to reproduce it.

  1. Create a new Wix v3 bootstrapper project. (It is the same for the other projects)
  2. Unload the .wixproj
  3. Try to edit the project
    grafik
  • Describe the behavior you expected and how it differed from the actual behavior.
    As you can see in the screenshot the lineendings are inconsistent. Inside the xml comments are only LF and no CR LF.
@barnson

This comment has been minimized.

Show comment
Hide comment
@barnson

barnson Nov 17, 2017

Member

Confirmed the .vsix includes LF-only line endings.

Member

barnson commented Nov 17, 2017

Confirmed the .vsix includes LF-only line endings.

@BMurri

This comment has been minimized.

Show comment
Hide comment
@BMurri

BMurri May 5, 2018

Collaborator

Figured this out. Visual Studio does the equivalent of parsing the project file templates into a DOM tree, replaces the replacement strings, then writes out the tree as the new project file without preserving whitespace. Since VS's defaults are tabs and CRLF line endings, and since the multi-line comments aren't reformatted (although they are string-replaced), the behavior above does result.

The two solutions are (take your pick):

  • Replace the line endings in all *proj files in the templates with CRLF.
  • Open a bug with VS and ask them to preserve at least line endings (if not insignificant whitespace) when processing template project files.

I think the former has a higher likelihood of success.

Interestingly enough, the source file templates are NOT processed the same way, even though they also have the string replacements. This leads me to the conclusion that the project files are processed by VS in other ways that don't preserve insignificant whitespace, causing this issue.

Thus, only the *proj template files need to be changed.

Collaborator

BMurri commented May 5, 2018

Figured this out. Visual Studio does the equivalent of parsing the project file templates into a DOM tree, replaces the replacement strings, then writes out the tree as the new project file without preserving whitespace. Since VS's defaults are tabs and CRLF line endings, and since the multi-line comments aren't reformatted (although they are string-replaced), the behavior above does result.

The two solutions are (take your pick):

  • Replace the line endings in all *proj files in the templates with CRLF.
  • Open a bug with VS and ask them to preserve at least line endings (if not insignificant whitespace) when processing template project files.

I think the former has a higher likelihood of success.

Interestingly enough, the source file templates are NOT processed the same way, even though they also have the string replacements. This leads me to the conclusion that the project files are processed by VS in other ways that don't preserve insignificant whitespace, causing this issue.

Thus, only the *proj template files need to be changed.

@BMurri

This comment has been minimized.

Show comment
Hide comment
@BMurri

BMurri May 5, 2018

Collaborator

Interestingly, the source files have windows-line endings (CRLF), yet the templates installed via the VSIX are unix-line endings (LF). Continuing to investigate...

Collaborator

BMurri commented May 5, 2018

Interestingly, the source files have windows-line endings (CRLF), yet the templates installed via the VSIX are unix-line endings (LF). Continuing to investigate...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment