-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
CopyUpToDateMarker path too long #9346
Comments
MSBuild team triage: @drewnoakes Do you know of any reason we could not change this file name? |
I can't think of a technical reason not to change the name. The .NET Project System obtains the name via the That said, that approach is not a real fix. What component is hitting this limit, and can it be changed to support long paths properly? |
@drewnoakes Thank you for confirming. |
Yes, this happens during evaluation, so project load in the IDE is affected. And yes, the proposed change is just to reduce the probability that people will hit the limit when long path are not supported. |
I'm wondering whether we can do this in reasonable and correct way. <PropertyGroup Condition ="'$(ShortProjectName)' == '' and '$(ProjectName)' != '' and '$(ProjectGuid)' != ''">
<ShortProjectName>$(ProjectName)</ShortProjectName>
<ShortProjectName Condition="'$(ProjectName.Length)' > '16'">$(ProjectName.Substring(0,8)).$(ProjectGuid.Substring(1,8))</ShortProjectName>
</PropertyGroup> However So we can possbily shorten the marker in case the Thoughts on this @rainersigwald? |
Within a solution, a max length project name prefix cannot be considered unique. Project names are often hierarchical and only differ at the end. |
It's VS/ |
Correct. |
It would be possible to generate a GUID by hashing the project name, when ProjectGuid is not defined. |
…entVersion.targets (#9520) #9387 introduced improved hashing for [`[MSBuild]::StableStringHash`](https://learn.microsoft.com/en-us/visualstudio/msbuild/property-functions?view=vs-2022#msbuild-stablestringhash), that however broke internal functionality relying on the hash to be stable between versions (despite documented otherwise). ### Changes Made * Reverted all the hashing changes * Kept the UTD marker change (fixing #9346) ### Note Longer term fix: #9519
Fixes #10066 [GB18030] Failed to run the WebAPI project that named as GB18030 provided level3 strings ### Context OS: Windows 11 Enterprise 22H2 ZH-CN Affected Build: 9.0.0-preview.4.24209.5, Aso repro on 8.0.300-preview.24203.14(8.0.2) Steps to reproduce: Use CLI to create WebAPI project copying GB18030 characters, for example: ``` dotnet new webapi -controllers -o 㐇𠁠𪨰𫠊𫦠𮚮⿕# cd 㐇𠁠𪨰𫠊𫦠𮚮⿕# dotnet run ``` Without this PR: ``` dotnet run Building... Restore complete (0.5s) You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy 㐇𠁠𪨰𫠊𫦠��⿕# failed with 2 error(s) (2.9s) → bin/Debug/net9.0/㐇𠁠𪨰𫠊𫦠��⿕#.dll /workspaces/runtime/.dotnet/sdk/9.0.100-preview.3.24204.13/Microsoft.Common.CurrentVersion.targets(5578,5): error MSB3491: Could not write lines to file "obj/Debug/net9.0/㐇𠁠𪨰𫠊𫦠��⿕#.csproj.FileListAbsolute.txt". Unable to translate Unicode character \\uD86E at index 2368 to specified code page. /workspaces/runtime/.dotnet/sdk/9.0.100-preview.3.24204.13/Microsoft.Common.CurrentVersion.targets(5823,5): error MSB3491: Could not write lines to file "obj/Debug/net9.0/㐇𠁠𪨰𫠊𫦠��⿕#.csproj.FileListAbsolute.txt". Unable to translate Unicode character \\uD86E at index 2368 to specified code page. Build failed with 2 error(s) in 3.8s The build failed. Fix the build errors and run again. ``` With this PR: ``` dotnet run Building... Restore complete (0.5s) You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy 㐇𠁠𪨰𫠊𫦠��⿕# succeeded (0.6s) → bin/Debug/net9.0/㐇𠁠𪨰𫠊𫦠��⿕#.dll Build succeeded in 1.5s info: Microsoft.Hosting.Lifetime[14] Now listening on: http://localhost:5210 info: Microsoft.Hosting.Lifetime[0] Application started. Press Ctrl+C to shut down. info: Microsoft.Hosting.Lifetime[0] Hosting environment: Development info: Microsoft.Hosting.Lifetime[0] Content root path: /workspaces/reproGB/㐇𠁠𪨰𫠊𫦠��⿕# ^Cinfo: Microsoft.Hosting.Lifetime[0] Application is shutting down... ``` ### Changes Made Changed the way we create a substring to prevent cutting surrogates in half. ### Testing Added a test for new substring function. ### Regerssion Yes, after #9346.
reported by @olgaark:
The item in question: https://github.com/dotnet/msbuild/blob/main/src/Tasks/Microsoft.Common.CurrentVersion.targets#L392
The text was updated successfully, but these errors were encountered: