Rank: Advanced Member
Groups: Registered
Joined: 1/13/2025(UTC) Posts: 30 Location: Sweden
Thanks: 5 times Was thanked: 6 time(s) in 6 post(s)
|
I found a workaround for this. In the global setting I changed the Build SDK to VS2022. After that the problem has disappeared. I haven't been able to reproduce the original problem in a smaller solution unfortunately. I let AI (codex) analyze the logs and this is the output from that: Quote: Environment - NCrunch version: 5.20.0.2 - Visual Studio: 2022 - Reproduced in: NCrunch Console Tool - Project type where the failure happens: old-style .NET Framework C# project (`ToolsVersion="14.0"`, `TargetFrameworkVersion v4.7.2`) - Referenced projects: sibling projects, some with Swedish characters (`å`, `ä`, `ö`) in folder/project names
Observed behavior - In the original repository, the test project's `.csproj` contains valid UTF-8 `ProjectReference` paths with Swedish characters. - In the NCrunch workspace copy of that same `.csproj`, those characters are replaced by literal `??`. - After this rewrite, the directly referenced projects are no longer resolved correctly. - The build then fails with real compiler errors (`CS0234` / `CS0246`) because namespaces/types from those projects disappear.
Anonymized example of the problem
Original project file: <ProjectReference Include="..\..\..\Services\Projectå\Projectå.csproj" /> <ProjectReference Include="..\..\..\Services\PaymentMethodä\PaymentMethodä.csproj" />
NCrunch workspace copy: <ProjectReference Include="..\..\..\Services\Project??\Project??.csproj" /> <ProjectReference Include="..\..\..\Services\PaymentMethod??\PaymentMethod??.csproj" />
What I verified - The original `.csproj` is correct. - The NCrunch workspace copy is corrupted. - The actual compiler errors are missing namespace/type errors, not just reference warnings. - The `csc.exe` invocation for the failing test project still includes the main application assembly, but not the assemblies from the corrupted direct project references. - This strongly suggests the failure is caused by the corrupted `ProjectReference` paths in the NCrunch workspace.
Expected behavior - NCrunch should preserve the original Unicode characters when generating the workspace copy of the project file. - Direct `ProjectReference` items with `å`, `ä`, `ö` in the path should resolve exactly the same as outside the NCrunch workspace.
Important note - I tried to isolate this into a minimal public repro using both SDK-style and old-style anonymized solutions, including Unicode in `ProjectReference`, `Compile`, `Content`, and a separate project-under-test consumed as DLL. - Those reduced repros all built successfully in NCrunch Console and did not reproduce the corruption. - So at the moment I can confirm the bug in the real solution, but I do not yet have a minimal standalone repro.
My current conclusion - The most likely root cause is an encoding or workspace-generation issue in NCrunch affecting certain legacy project files when Unicode characters appear in project-relative paths.
|