Sergio0694 / PolySharp

PolySharp provides generated, source-only polyfills for C# language features, to easily use all runtime-agnostic features downlevel. Add a reference, set your C# version to latest and have fun! 🚀
MIT License
1.83k stars 49 forks source link

PoloySharp blocked by windows path length (260) limit #109

Open sui-zhiyuan opened 1 month ago

sui-zhiyuan commented 1 month ago

Description (optional)

If Project foder path legth is larger then 72, Generating file might fail due to path is longer then 260.

Reproduction Steps

  1. Create a csproj in folde like C:\Users\dummy\project\dummyrepor\dotnetbackend\dummyrepo.somebasementrepo\
  2. Import PolySharp
  3. Build

Expected Behavior

Build success.

Actual Behavior

Got Build Error: CS0016 could not write to output“C:\Users\dummy\project\dummyrepor\dotnetbackend\dummyrepo.somebasementrepo\obj\Debug\netstandard2.0\generated\PolySharp.SourceGenerators\PolySharp.SourceGenerators.PolyfillsGenerator\System.Runtime.CompilerServices.InterpolatedStringHandlerArgumentAttribute.g.cs” ........

System info

Additional context (optional)

Can we remove the repeated PolySharp.SourceGenerators in the path to reduce path length ?

TheHandsomeBanana commented 1 month ago

Hey, if you are using Windows 10 or 11, you can enable "Long Paths" using Group Policies or the Registry. Keep in mind that there a legacy applications that rely on the Path limit so this wont work for those.