ASPNETCOMPILER : error ASPRUNTIME: The specified path, file name, or both are too long
症状
When running the build on a Windows machine, build fails and the following error shows up in the logs even though the file name or path are nowhere near the limit stated:
....
c:\Users\Administrator\bamboo-agent-home\xml-data\build-dir\ERS-THISISATEST-JOB1\console\ENS_LandingPoint.aspx.cs(31): warning CS0169: The field 'ENS_LandingPoint.STitle' is never used [C:\Users\Administrator\bamboo-agent-home\xml-data\build-dir\ERS-THISISATEST-JOB1\console\mmc.metaproj]
c:\Users\Administrator\bamboo-agent-home\xml-data\build-dir\ERS-THISISATEST-JOB1\console\ENS_LandingPoint.aspx.cs(32): warning CS0169: The field 'ENS_LandingPoint.SUsername' is never used [C:\Users\Administrator\bamboo-agent-home\xml-data\build-dir\ERS-THISISATEST-JOB1\console\mmc.metaproj]
c:\Users\Administrator\bamboo-agent-home\xml-data\build-dir\ERS-THISISATEST-JOB1\console\District Console.aspx.cs(23): warning CS0169: The field 'FPConsole.site_adminid' is never used [C:\Users\Administrator\bamboo-agent-home\xml-data\build-dir\ERS-THISISATEST-JOB1\console\mmc.metaproj]
c:\Users\Administrator\bamboo-agent-home\xml-data\build-dir\ERS-THISISATEST-JOB1\console\District Console.aspx.cs(25): warning CS0169: The field 'FPConsole.targ_site_id' is never used [C:\Users\Administrator\bamboo-agent-home\xml-data\build-dir\ERS-THISISATEST-JOB1\console\mmc.metaproj]
c:\Users\Administrator\bamboo-agent-home\xml-data\build-dir\ERS-THISISATEST-JOB1\console\District Console.aspx.cs(36): warning CS0169: The field 'FPConsole.accountID' is never used [C:\Users\Administrator\bamboo-agent-home\xml-data\build-dir\ERS-THISISATEST-JOB1\console\mmc.metaproj]
c:\Users\Administrator\bamboo-agent-home\xml-data\build-dir\ERS-THISISATEST-JOB1\console\District Console.aspx.cs(37): warning CS0169: The field 'FPConsole.displayname' is never used [C:\Users\Administrator\bamboo-agent-home\xml-data\build-dir\ERS-THISISATEST-JOB1\console\mmc.metaproj]
ASPNETCOMPILER : error ASPRUNTIME: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters. [C:\Users\Administrator\bamboo-agent-home\xml-data\build-dir\ERS-THISISATEST-JOB1\console\mmc.metaproj]
The command exited with code 1.
Done executing task "AspNetCompiler" -- FAILED.
Done building target "Build" in project "mmc.metaproj" -- FAILED.
Done Building Project "C:\Users\Administrator\bamboo-agent-home\xml-data\build-dir\ERS-THISISATEST-JOB1\console\mmc.metaproj" (default targets) -- FAILED.
Done executing task "MSBuild" -- FAILED.
Done building target "Build" in project "ers_console.sln" -- FAILED.
Done Building Project "C:\Users\Administrator\bamboo-agent-home\xml-data\build-dir\ERS-THISISATEST-JOB1\console\ers_console.sln" (default targets) -- FAILED
.....
回避策
Move the build directory outside the current directory. You can move to a root directory, like "C:\". In this example build directory was moved to "C:\bamboo-agent-home" from "C:\Users\Administrator\bamboo-agent-home\...". If the build is running on a remote agent, follow the instructions on this page: Moving Bamboo Agent Home to move <bamboo-agent-home> outside the current directory.
This 260 characters limit issue is caused by a Windows limit and is unrelated to Bamboo settings. Please refer to the following pages for more information: