BepInEx plugin that patches System.IO.File.Move to support Windows long paths (paths longer than MAX_PATH, 260 chars) in Unity games/mods.
Some Unity + modded game workflows still hit path length issues when moving files, especially in deep folder structures. This plugin intercepts file move calls and routes them through a long-path-capable implementation.
- Harmony patch for
System.IO.File.Move. - Windows long-path conversion (
\\?\and\\?\UNC\handling). - Drop-in BepInEx plugin (no game-side code changes required).
- Windows (plugin relies on
kernel32.dllAPIs). - BepInEx 5.x.
- .NET Framework 4.6 target compatibility (
net46).
- Build the project in
Release. - Copy
UnityLongPathPlugin.dllinto your game's BepInEx plugins folder:BepInEx/plugins/ - Start the game and verify plugin load in BepInEx logs.
dotnet restore UnityLongPathPlugin.sln
dotnet build UnityLongPathPlugin.sln -c Release- Tag a version like
v1.0.1. - Push the tag to GitHub.
- The
Releaseworkflow builds the plugin, packages it, and publishes a GitHub release asset.
UnityLongPathPlugin/Plugin.cs: BepInEx entry point.UnityLongPathPlugin/Patcher.cs: Harmony patch registration andFile.Moveprefix.UnityLongPathPlugin/LongFile.cs: Win32 long-path file operations..github/workflows/ci.yml: GitHub Actions CI workflow..github/workflows/release.yml: GitHub Actions release workflow.
Contributions are welcome. Please read CONTRIBUTING.md before opening a pull request.
Please review CODE_OF_CONDUCT.md when participating in discussions and pull requests.
To report vulnerabilities, see SECURITY.md.
This project is licensed under the MIT License. See LICENSE.
See CHANGELOG.md for release notes and pending changes.