FabianLauer / vs-code-xml-format

Simple XML formatter for Visual Studio Code.
https://marketplace.visualstudio.com/items/fabianlauer.vs-code-xml-format
MIT License
7 stars 5 forks source link

Format on save is breaking .csproj file in VS Code projects #13

Open dyzGBT opened 7 years ago

dyzGBT commented 7 years ago

Perhaps I can modify a setting, but in the event anyone else has an issue, when opening and adding code directly to a .NET Core .csproj file, on save the formatting breaks and during dotnet restore the following error is thrown as it adds hard returns and spaces around portions of code.

C:\Program Files\dotnet\sdk\1.0.1\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\Microsoft.NET.Sdk.Publish.targets(90,5): error MSB4184: The expression "[System.IO.Path]::GetFullPath(C:\test\obj\Debug\ [C:\test\test.csproj] C:\Program Files\dotnet\sdk\1.0.1\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\Microsoft.NET.Sdk.Publish.targets(90,5): error MSB4184: netcoreapp1.1 [C:\test\test.csproj] C:\Program Files\dotnet\sdk\1.0.1\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\Microsoft.NET.Sdk.Publish.targets(90,5): error MSB4184: \PubTmp)" cannot be evaluated. Illegal characters in path. Parameter name: path [C:\test\test.csproj]

crohit92 commented 4 years ago

I also am facing the same issue. Is there any solution for this?

ptako commented 2 years ago

I also am facing the same issue. Is there any solution for this?

Turn off code formatting. It looks like csproj files are whitespace sensitive. When you're formatting: <TargetFramework>net6.0</TargetFramework> gets replaced with:

<TargetFramework>
net6.0
</TargetFramework>

and this seems to be a problem here.

jgramling01 commented 9 months ago

Having this problem still.