Bug 35626 - The "XamlCTask" task failed unexpectedly
Summary: The "XamlCTask" task failed unexpectedly
Status: RESOLVED INVALID
Alias: None
Product: Forms
Classification: Xamarin
Component: iOS ()
Version: unspecified
Hardware: Macintosh Windows
: --- normal
Target Milestone: ---
Assignee: Stephane Delcroix
URL:
Depends on:
Blocks:
 
Reported: 2015-11-06 12:09 UTC by Robin Alderliesten
Modified: 2016-04-13 19:53 UTC (History)
5 users (show)

Tags:
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 or GitHub 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:
Status:
RESOLVED INVALID

Description Robin Alderliesten 2015-11-06 12:09:54 UTC
Using the Xamarin.Forms 1.5.1.6471 (and tried other 1.5.x versions, too) I keep getting the "XamlCTask" failed error when I try to build the App.iOS version.

Working on a MacBook, running Windows in VMWare Fusion. Using Xamarin.Forms for Visual Studio.
The solution is under version control in TFS.

I shared a folder on my Mac (/Sources/TFS) with the Windows machine (Z:\TFS). It has worked for a while, but this error somehow keeps coming back.

There's an <IntermediateOutputPath /> attribute in the iOS projectfile which maps to a folder on the C-drive.
<IntermediateOutputPath>C:\Users\Robin\AppData\local\Temp\vs2D51.tmp\iPhoneSimulator\Debug</IntermediateOutputPath>

However, the IntermediateOutputPath is also used to construct a directory in the /packages/Xamarin.Forms.1.5.1.6471/build/portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10/Xamarin.Forms.targets file like this:

<Target Name="XamlC">
   <XamlCTask
      Assembly="$(MSBuildProjectDirectory)\$(IntermediateOutputPath)$(TargetFileName)"
      ...etc...
   />
</Target>

This results in an illegal path and crashes the build.
e.g. Z:\TFS\Project\Main\C:\Users\Robin\AppData... etc.

I'm hoping this is a known bug and will be fixed soon, because I'm unable to continue development at the moment.
Comment 1 Robin Alderliesten 2015-11-06 12:16:17 UTC
PS: Removing the $(MSBuildProjectDirectory)\ from the Assembly property results in Unexpected error: please file bug report. So here it is :)
Comment 2 Rolf Bjarne Kvinge [MSFT] 2015-11-06 13:56:22 UTC
I believe the XamlCTask task comes from Xamarin.Forms, so I'm reassigning this.
Comment 3 Martin Brekhof 2015-11-06 17:30:51 UTC
Additional information (Robin is a colleague): I am running VS2015 on a Windows 8.1 Pro machine and build using a MacBook pro build host. 
If I get the project Robin has problems with through TFS and manually remove the proj file to get rid of these 
<IntermediateOutputPath>C:\Users\Robin\AppData\local\Temp\vs2D51.tmp\iPhoneSimulator\Debug</IntermediateOutputPath>
entries it builds fine on my setup.

However f I leave the entries they change during the build process to my local directories (C:\Users\Martin...etc.) and the task fails also. Below the output as VS2015 shows when failing:
Severity	Code	Description	Project	File	Line
Error		The "XamlCTask" task failed unexpectedly.
System.NotSupportedException: The given path's format is not supported.

Server stack trace: 
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at Mono.Cecil.ModuleDefinition.GetFileStream(String fileName, FileMode mode, FileAccess access, FileShare share)
   at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters)
   at Xamarin.Forms.Build.Tasks.XamlCTask.Compile()
   at Xamarin.Forms.Build.Tasks.XamlCTask.Execute()
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [0]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at Microsoft.Build.Framework.ITask.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()	RapApp.iOS
Comment 4 Cotutiu Lucian 2015-11-10 09:30:00 UTC
I'm getting the same error in VS 2013 after updating Xamarin.Forms libraries to version 1.5.1.6471. I get the same error on MAC to. Is there an workaround to build my solution util the issue is solved?
Comment 5 Martin Brekhof 2015-11-18 04:36:08 UTC
We solved the problem by tweaking our settings on filesystem level.
See : https://forums.xamarin.com/discussion/55411/hardware-setup-for-cross-platform#latest