You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NET Framework tests will fail to run in VS when any part contains a special character.
[24/02/2025 6:18:10.960 pm] [Error] Process: C:\Users\jajares\source\repos\TestProject136\TestProject136\bin\Debug\net481\TestProject136.exe, Exception: StreamJsonRpc.RemoteInvocationException: System.ArgumentException: Invalid control character '\u0003' found in string
Parameter name: text
at Jsonite.Json.JsonWriter.WriteString(String text) in /_/src/Platform/Microsoft.Testing.Platform/ServerMode/JsonRpc/Json/Jsonite/Jsonite.cs:line 976
at Jsonite.Json.JsonWriter.Write(Object value) in /_/src/Platform/Microsoft.Testing.Platform/ServerMode/JsonRpc/Json/Jsonite/Jsonite.cs:line 835
at Jsonite.Json.JsonWriter.WriteObject(IEnumerable`1 members) in /_/src/Platform/Microsoft.Testing.Platform/ServerMode/JsonRpc/Json/Jsonite/Jsonite.cs:line 889
at Jsonite.Json.JsonWriter.Write(Object value) in /_/src/Platform/Microsoft.Testing.Platform/ServerMode/JsonRpc/Json/Jsonite/Jsonite.cs:line 844
at Jsonite.Json.JsonWriter.WriteObject(IEnumerable`1 members) in /_/src/Platform/Microsoft.Testing.Platform/ServerMode/JsonRpc/Json/Jsonite/Jsonite.cs:line 889
at Jsonite.Json.JsonWriter.Write(Object value) in /_/src/Platform/Microsoft.Testing.Platform/ServerMode/JsonRpc/Json/Jsonite/Jsonite.cs:line 844
at Jsonite.Json.JsonWriter.WriteArray(IEnumerable list) in /_/src/Platform/Microsoft.Testing.Platform/ServerMode/JsonRpc/Json/Jsonite/Jsonite.cs:line 918
at Jsonite.Json.JsonWriter.Write(Object value) in /_/src/Platform/Microsoft.Testing.Platform/ServerMode/JsonRpc/Json/Jsonite/Jsonite.cs:line 847
at Jsonite.Json.JsonWriter.WriteObject(IEnumerable`1 members) in /_/src/Platform/Microsoft.Testing.Platform/ServerMode/JsonRpc/Json/Jsonite/Jsonite.cs:line 889
at Jsonite.Json.JsonWriter.Write(Object value) in /_/src/Platform/Microsoft.Testing.Platform/ServerMode/JsonRpc/Json/Jsonite/Jsonite.cs:line 844
at Jsonite.Json.JsonWriter.WriteObject(IEnumerable`1 members) in /_/src/Platform/Microsoft.Testing.Platform/ServerMode/JsonRpc/Json/Jsonite/Jsonite.cs:line 889
at Jsonite.Json.JsonWriter.Write(Object value) in /_/src/Platform/Microsoft.Testing.Platform/ServerMode/JsonRpc/Json/Jsonite/Jsonite.cs:line 844
at Jsonite.Json.Serialize(Object value, JsonSettings settings) in /_/src/Platform/Microsoft.Testing.Platform/ServerMode/JsonRpc/Json/Jsonite/Jsonite.cs:line 142
at Microsoft.Testing.Platform.ServerMode.FormatterUtilities.MessageFormatter.SerializeAsync(Object obj) in /_/src/Platform/Microsoft.Testing.Platform/ServerMode/JsonRpc/FormatterUtilities.cs:line 26
at Microsoft.Testing.Platform.ServerMode.StreamMessageHandler.<WriteRequestAsync>d__9.MoveNext() in /_/src/Platform/Microsoft.Testing.Platform/ServerMode/JsonRpc/StreamMessageHandler.cs:line 127
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
<!-- file TestProject136.csproj -->
<ProjectSdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0;net481</TargetFrameworks>
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<EnableMSTestRunner>true</EnableMSTestRunner>
<OutputType>Exe</OutputType>
<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>
<!-- Displays error on console in addition to the log file. Note that this feature comes with a performance impact. For more information, visit https://learn.microsoft.com/dotnet/core/testing/unit-testing-platform-integration-dotnet-test#show-failure-per-test-->
<TestingPlatformShowTestsFailure>true</TestingPlatformShowTestsFailure>
</PropertyGroup>
<ItemGroup>
<PackageReferenceInclude="Microsoft.NET.Test.Sdk"Version="17.12.0" />
<PackageReferenceInclude="Microsoft.Testing.Extensions.CodeCoverage"Version="17.12.6" />
<PackageReferenceInclude="Microsoft.Testing.Extensions.TrxReport"Version="1.4.0" />
<PackageReferenceInclude="MSTest"Version="3.6.4" />
</ItemGroup>
<ItemGroup>
<UsingInclude="Microsoft.VisualStudio.TestTools.UnitTesting" />
</ItemGroup>
</Project>
Expected behavior
Actual behavior
Additional context
This behavior is taken from the original Jsonite implementation, just converted to use our guard. See if there is any reason to not escape those chars, the \u code seems that it should work for all, we just decide to encode some in special way to keep them more readable in the json.
Describe the bug
NET Framework tests will fail to run in VS when any part contains a special character.
Steps To Reproduce
Expected behavior
Actual behavior
Additional context
This behavior is taken from the original Jsonite implementation, just converted to use our guard. See if there is any reason to not escape those chars, the \u code seems that it should work for all, we just decide to encode some in special way to keep them more readable in the json.
https://github.com/microsoft/testfx/blob/main/src/Platform/Microsoft.Testing.Platform/ServerMode/JsonRpc/Json/Jsonite/Jsonite.cs#L976
The text was updated successfully, but these errors were encountered: