Visual Studio unknown build error. The fully qualified name must be less than 260 characters

前端 未结 6 1936
执笔经年
执笔经年 2021-01-01 10:23

I\'m having trouble while building my WPF solution. Everytime I try to build it, I get this error message:

Unknown build error, \'The specified path,

相关标签:
6条回答
  • 2021-01-01 10:44

    It is issue with build defination workspace "Build Agent Folder location" VS adds paths example: $(SourceDir)E:\Somedirectory\ProjectName\ Just keep $(SourceDir) in filed

    0 讨论(0)
  • 2021-01-01 10:54

    This is a well-known restriction in the Windows win32 api. The directory in which you stored your project is nested too deep. The full path name of a file cannot contain more than 259 characters. Beyond this, lots of C code that uses MAX_PATH starts failing due to buffer overflows.

    Move your solution to another directory, one that's closer to the root.

    0 讨论(0)
  • 2021-01-01 10:59

    I had the same problem. My checkout path was shorter than the path used on my CI server. It built OK on the CI server, and all my colleagues machines. Our paths are the same length because our company has fixed length user names. I was the only machine that could not build the solution due to long paths.

    If you go to these folders:

    C:\Windows\Microsoft.NET\Framework

    C:\Windows\Microsoft.NET\Framework64

    C:\Users\[UserName]\AppData\Local\Temp

    Find the version of .NET you are using with your solution, then delete the "Temporary ASP.NET Files" folders from which ever versions you think are effecting your build.

    You can delete them all, your next build of a web project might take a little bit longer as there will be no pre-compiled assemblies...

    This solution worked for me on a solution containing ASP.NET projects - it wont work on WPF projects that others have mentioned in their answers, unless their solution also contains ASP.NET projects.

    Searching for the error string VS gives you brought me here, so I figured it might help someone else, if not the Op with a WPF build issue.

    If these fail - you can try searching your solution root recursively for files/folders with paths that are greater the 260, by performing the following:

    • Open Powershell

    • cd <path to solution root>

    • cmd /c dir /s /b |? {$_.length -gt 260} > output.txt

    This will pipe a list of files with paths > 260 to the output.txt file which will be newly created in the root of your solution.

    This will help you find files within your solution that are too long.

    0 讨论(0)
  • 2021-01-01 11:07

    There is registry approach which can be used at least for Windows 10:
    Value of the parameter HKLM\SYSTEM\CurrentControlSet\Control\FileSystem LongPathsEnabled (Type: REG_DWORD) should be set to 1. You don't even need top restart anything (IDE or PC).

    0 讨论(0)
  • 2021-01-01 11:08

    No worry....This error comes because of long path name,Suppose your project folder name is "myproject".

    You Just Change location of project folder...Put your Project "myproject" to D:\myproject or or F:\myproject drive.Then You Publish again..Its work...

    Happy Coding...

    0 讨论(0)
  • 2021-01-01 11:09

    I had a similar issue where the compiler reported that there was a problem with the file ASPNETCOMPILER. The actual issue was that the solution contained a node_modules folder, and this folder can contain very lengthy paths, and it looks like the compiler can't handle this.

    Windows 8.1 and 10 have an option to increase the Win32 path limit:

    • Open Group Policy Editor (Press Windows+R and type gpedit.msc and hit Enter)
    • From the Group Policy Editor window, navigate to the following node: Local Computer Policy\Computer Configuration\Administrative Templates\System\Filesystem
    • Doubleclick on Enable Win32 long paths option and enable it.

    This may allow you to temporarily move the problem folder out of the build, which may allow you to successfully build, then you may be able to add the folder back into the solution without affecting anything.

    0 讨论(0)
提交回复
热议问题