ASP.NET Core - Windows 10 Pro - Publish to IIS - The specified path, file name, or both are too long

217 views Asked by At

I'm trying to publish an ASP.NET Core web application with Angular frontend to my webhosting account. The project uses SSR, which causes generated files to end up at a path longer than 260 characters.

Usually I put the solution folder directly within my C:\ drive in order to prevent paths from becoming longer than 260 characters, and this works fine.

Yesterday I acquired Windows 10 Pro and did the following things:

  • gpedit.msc → Computer configuration → Administrative Templates → System → File System → Enable Win32 long paths = Enabled
  • Regedit → Locate HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled was already set to 1
  • Reboot my computer

Now I'm trying to publish my ASP.NET Core with Angular application with Visual Studio (Administrator) through Web Deploy, but I'm still getting the PathTooLongException

Unable to copy file

Why is this still happening?

Edit:

I tried adding a manifest file to my project as stated here, but it's still not working: (longpaths.manifest inside my project)

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:compatibility.v1">
  <application xmlns="urn:schemas-microsoft-com:asm.v3">
    <windowsSettings>
      <longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
    </windowsSettings>
  </application>
</assembly>
0

There are 0 answers