Bug 17662 - "Path too long" error when building VS 2012 Xamarin.IOS project
Summary: "Path too long" error when building VS 2012 Xamarin.IOS project
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: General ()
Version: 1.10.x
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: vsx
Depends on:
Reported: 2014-02-07 19:29 UTC by Jon Goldberger [MSFT]
Modified: 2014-07-19 05:52 UTC (History)
7 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Comment 1 Jon Goldberger [MSFT] 2014-02-07 19:30:57 UTC
From case 60569:
I understand why this is happening, but I need to know how to fix it without having to move my entire project to the root folder of my C: drive in an attempt to shorten all of the file paths so that the compiled paths are less than 248 or 260 characters. We have some long file paths that are generated by tools and simply can't be shortened. They only become too long when they're copied during the build process. I have a rough idea of what's happening with MSBuild and I took a look at Xamarin.MonoTouch.Common.targets - is there anything in there that can be changed easily, like the output folder used by MonoTouchBundlePrepareFilePaths? Or can I add something to the "Additional mtouch arguments" in the iOS Build project settings, maybe? Other options? Thanks!
Failed build output:

2> iPadWrapper -> C:\Users\cseaman\Documents\Visual Studio 2012\Projects\FSDHCW\Trunk\Source\iPadWrapper\bin\iPhoneSimulator\Debug\iPadWrapper.exe
3>Build started.
3>Project "iPadWrapper.csproj" (_RemoteBuild target(s)):
3>Target "_ComputeBundleContentPaths" in file "C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.MonoTouch.Common.targets" from project "C:\Users\cseaman\Documents\Visual Studio 2012\Projects\FSDHCW\Trunk\Source\iPadWrapper\iPadWrapper.csproj" (target "_PrepareApplicationBundle" depends on it):
3>The "MonoTouchBundlePrepareFilePaths" task failed unexpectedly.
3>System.IO.PathTooLongException: 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.
3> at System.IO.PathHelper.GetFullPathName()
3> at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
3> at System.IO.Path.GetFullPathInternal(String path)
3> at System.IO.Path.GetFullPath(String path)
3> at Xamarin.MonoTouch.Build.Tasks.MonoTouchBundlePrepareFilePaths.CopyItems(ITaskItem[] sourceFiles, List`1 outFiles, String targetDir)
3> at Xamarin.MonoTouch.Build.Tasks.MonoTouchBundlePrepareFilePaths.CopyContent(List`1 items)
3> at Xamarin.MonoTouch.Build.Tasks.MonoTouchBundlePrepareFilePaths.Execute()
3> at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
3> at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext()
3>Done building target "_ComputeBundleContentPaths" in project "iPadWrapper.csproj" -- FAILED.
3>Done building project "iPadWrapper.csproj" -- FAILED.
3>Build FAILED.
Comment 3 Sadik Ali 2014-03-13 07:34:09 UTC
I checked this issue on below environments:

VS 2012
X iOS 1.10.47

I have followed below steps:

1. Created iOS project with long file path and noticed that VS does not allowed to created project for long path exceeded.
Screen cast: http://screencast.com/t/CdKkSuJk
2. I trimmed project path and created iOS project.
3. I tried to download "Google Play Services" services  from component and noticed that download failed due to long project path.
Refer screen shot: http://screencast.com/t/HdxJcMPJ

I am able to reproduce this  bug for comment 2.
Comment 4 Jose Miguel Torres 2014-07-19 05:52:08 UTC
That is a Windows limitation, not sure what we can do here in order to work around that situation... closing this bug then.