Fixed: Long Path Support on Mono and .Net

pull/835/head
Qstick 6 years ago
parent 70155cae18
commit b5d502bd5d

@ -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.Reflection;
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 @@ namespace NzbDrone.Host
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…
Cancel
Save