Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
Updating the NuGet package for Xamarin.Forms in the attached test case does not update the build task and it still fails to build from a bug in the older version of the assembly.
**Steps to Reproduce:**
1. Download the test case.
2. Open the test case in Xamarin Studio on Windows.
3. Build the PCL project (XFormsTest).
4. The project will fail to build with an exception related to XamlG task failed...
5. This was a bug that was fixed in a newer Forms package.
6. Update the Forms package by right clicking on it and choosing Update Package to get the bug fix.
7. Re build the PCL project.
8. The build still fails with the same error.
The build still fails even after updating the NuGet package, which should have resolved it.
The build should succeed because the newer package has the bug fix for the issue causing the failed build.
**Build Date & Platform:**
XS (Windows) 5.5.2
Deleting the bin and obj folders does not help. Restarting XS will workaround the issue. Updating the Package before the first build (step 3) might also workaround this issue.
I am assuming the error you are seeing is the following:
"\XFormsTest\XFormsTest\XFormsTest.csproj(56,5): error : This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is ..\..\packages\Xamarin.Forms.1.0.6186\build\portable-win+net45+wp80+MonoAndroid10+MonoTouch10\Xamarin.Forms.targets."
If so this is been reported before:
Sorry, no that is not the error. The packages restore properly. But, the build still fails for a Forms related error "XamlG Task failed unexpectedly..."
That error is fixed in the new assembly, so its unexpected that the build would continue to fail after updating. Restarting XS allows the build to be successful. It is thought that this is because it is properly building with the new assembly.
OK I can reproduce it on Windows.
I modified the PCL project by removing the <Target Name="EnsureNuGetPackageBuildImports">... section since I was seeing the "This project references NuGet package(s) that are missing on this computer." error instead of the XamlG error.
Tried calling the RemoteProjectBuilder.Refresh () after the new Xamarin.Forms MSBuild target has been added to the project on updating the NuGet package but that does not seem to fix the problem.
Closing and re-opening the solution seems to fix the problem.
Something (MSBuild?) seems to be using the old Xamarin.Forms.Build.Tasks.dll. NuGet itself fails to remove this file when updating the Xamarin.Forms NuGet package in the project if it was compiled before the update and generated the XamlG error.
Closing the solution kills the separate MSBuild.exe task. Now the NuGet addin will do the same if an MSBuild import is removed from the project when updating the NuGet package.
This should be fixed in:
Xamarin Studio: 126.96.36.199 (master branch)