3F / MvsSln

🧩 Customizable VisualStudio .sln parser with project support (.vcxproj, .csproj., …). Pluggable lightweight r/w handlers at runtime, and more …
MIT License
140 stars 27 forks source link

Fix issue with string builder removing too much raw sln data on Unix platforms #58

Closed teekayarezee closed 1 year ago

teekayarezee commented 1 year ago

The implementations incorrectly assume there are two trailing characters to ignore for the newline (i.e. "\r\n"), which is the case for Windows, however this is only a single character on Unix platorms ("\n").

This results in writing corrupted data to the solution file (for example, manifesting as "EndProjec" appearing in the output sln file when using the WProject write handler).

This fix uses Environment.NewLine.Length to determine how many trailing characters to ignore, depending on which platform is being used.

3F commented 1 year ago

Thanks for the PR!

Yes, it's good to have something working before the final solution on the road.

Let's try to release a new public version immediately for NuGet after merge, just update the .version file's content up to 2.6.2 in PR; changelog.txt about fix with your credits if you prefer

teekayarezee commented 1 year ago

@3F No problem! I've just committed the recommended changes - I have also updated the versions referenced in MvsSln.csproj and MvsSlnVersion.cs to 2.6.2, to match the same format of the changes made in the 2.6.1 public release, in commit https://github.com/3F/MvsSln/commit/8dd3956aa8b86305d3419e697d01cd8f556673cb.

3F commented 1 year ago

Am I missed something on appveyor? o_o https://ci.appveyor.com/project/3Fs/mvssln-fxjnf/builds/47528754 https://ci.appveyor.com/project/3Fs/mvssln-fxjnf/history

At current time I can't access to my personal pc to debug the reason. Maybe tomorrow.

3F commented 1 year ago

oh, also, as far as I remember it, PRs should be built automatically by requesting appveyor CI but I don't see anything here anymore.

Too many changes out of my sight after a year :(

3F commented 1 year ago

There's another bug with vssbe API after MSBuild changes for .rsp files in modern environments -_- almost everything seems to be broken, like my life

Fortunately we can suppress it (for windows) temporarily via /noautorsp So I just added the key for appveyor CI like:

appveyor-build PublicRelease" /noautorsp"

(the quotes are in the correct position due to current code hack, hack again)

so much for one little thing ...

@teekayarezee Thanks again for your time, it is appreciated!