Skip to content

Commit

Permalink
docs: require enabled long-paths when contributing
Browse files Browse the repository at this point in the history
  • Loading branch information
earloc committed Nov 24, 2024
1 parent 4acfe9e commit f2ceea3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 24 deletions.
12 changes: 1 addition & 11 deletions docs/contributing/BuildFromSource.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Building Razor on Windows requires:
- Windows 10, version 1803 or newer
- At least 10 GB of disk space and a good internet connection (our build scripts download a lot of tools and dependencies)
- Git. <https://git-scm.org>
- [LongPaths](LongPaths.md) to be enabled

### macOS/Linux

Expand Down Expand Up @@ -81,17 +82,6 @@ Executing `.\restore.cmd` or `.\build.cmd` may produce these errors:
In most cases, this is because the option _Use previews of the .NET Core SDK_ in VS2019 is not checked. Start Visual Studio, go to _Tools > Options_ and check _Use previews of the .NET Core SDK_ under _Environment > Preview Features_.

### Common error: path too long (on windows)
If you encounter errors pointing to `path-too-long` errors, like:
```
Path: {{SOME-PATH}} exceeds the OS max path limit. The fully qualified file name must be less than 260 characters.
```
or
```
error LongPathsDisabled: Long paths are required for this project. See 'docs/contributing/LongPaths.md'.
```
see [LongPaths](LongPaths.md) on how to deal with this.

## Building with Visual Studio Code

Outside of Razor's language server and C# workspace logic, the bulk of our VS Code logic now lives in the [dotnet/vscode-csharp](https://github.com/dotnet/vscode-csharp) repo.
Expand Down
13 changes: 0 additions & 13 deletions docs/contributing/LongPaths.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,6 @@ Either import / execute [/eng/enable-long-path.reg] or invoke the following powe
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value "1" -PropertyType DWORD -Force
```

### Use [subst] to shorten your local path
> :warning: While this might work in your particular environment, chances are high that future changes might introduce even longer paths, which might then again result in above errors.
> Also, [subst] has no way to make a substitution permanent, so you might need to repeat this step after reboots, or ensure it get's executed at startup.
>
If you don't want to / can't enable long path support globally, try shortening your local path with [subst] where `R` is a free drive-letter, e.g.:

> ```ps1
> $dir = pwd
> subst R: $dir
> cd R:\
> ```
[git long paths]:https://stackoverflow.com/questions/22575662/filename-too-long-in-git-for-windows
[windows long paths support]:https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry#enable-long-paths-in-windows-10-version-1607-and-later
[subst]:https://learn.microsoft.com/de-de/windows-server/administration/windows-commands/subst
[/eng/enable-long-path.reg]:../../eng/enable-long-paths.reg

0 comments on commit f2ceea3

Please sign in to comment.