mirror of
https://github.com/lidarr/Lidarr
synced 2025-02-26 15:52:42 +00:00
Fixed: Long Path Support on Mono and .Net
This commit is contained in:
parent
70155cae18
commit
b5d502bd5d
4 changed files with 19 additions and 1 deletions
15
src/NzbDrone.Common/Disk/LongPathSupport.cs
Normal file
15
src/NzbDrone.Common/Disk/LongPathSupport.cs
Normal file
|
@ -0,0 +1,15 @@
|
|||
using System;
|
||||
|
||||
namespace NzbDrone.Common.Disk
|
||||
{
|
||||
public static class LongPathSupport
|
||||
{
|
||||
public static void Enable()
|
||||
{
|
||||
// Mono has an issue with enabling long path support via app.config.
|
||||
// This works for both mono and .net on Windows.
|
||||
AppContext.SetSwitch("Switch.System.IO.UseLegacyPathHandling", false);
|
||||
AppContext.SetSwitch("Switch.System.IO.BlockLongPaths", false);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -106,6 +106,7 @@
|
|||
<Compile Include="Disk\FileSystemLookupService.cs" />
|
||||
<Compile Include="Disk\DriveInfoMount.cs" />
|
||||
<Compile Include="Disk\IMount.cs" />
|
||||
<Compile Include="Disk\LongPathSupport.cs" />
|
||||
<Compile Include="Disk\MountOptions.cs" />
|
||||
<Compile Include="Disk\RelativeFileSystemModel.cs" />
|
||||
<Compile Include="Disk\FileSystemModel.cs" />
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
using System.Threading;
|
||||
using NLog;
|
||||
using NzbDrone.Common.Composition;
|
||||
using NzbDrone.Common.Disk;
|
||||
using NzbDrone.Common.EnvironmentInfo;
|
||||
using NzbDrone.Common.Exceptions;
|
||||
using NzbDrone.Common.Instrumentation;
|
||||
|
@ -32,6 +33,8 @@ public static void Start(StartupContext startupContext, IUserAlert userAlert, Ac
|
|||
throw new TerminateApplicationException("Missing system requirements");
|
||||
}
|
||||
|
||||
LongPathSupport.Enable();
|
||||
|
||||
_container = MainAppContainerBuilder.BuildContainer(startupContext);
|
||||
_container.Resolve<IAppFolderFactory>().Register();
|
||||
_container.Resolve<IProvidePidFile>().Write();
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
</startup>
|
||||
<runtime>
|
||||
<loadFromRemoteSources enabled="true" />
|
||||
<AppContextSwitchOverrides value="Switch.System.IO.UseLegacyPathHandling=false;Switch.System.IO.BlockLongPaths=false" />
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<probing privatePath="libs" />
|
||||
<dependentAssembly>
|
||||
|
|
Loading…
Reference in a new issue