Bug 32162 - Error initializing task FixedCreateCSharpManifestResourceName when updating Forms package
Summary: Error initializing task FixedCreateCSharpManifestResourceName when updating F...
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: NuGet ()
Version: 5.9
Hardware: PC Mac OS
: --- normal
Target Milestone: 5.10 (C6)
Assignee: Matt Ward
URL:
Depends on:
Blocks:
 
Reported: 2015-07-20 14:45 UTC by John Miller [MSFT]
Modified: 2015-08-13 12:54 UTC (History)
9 users (show)

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


Attachments
Test Case (6.76 MB, application/zip)
2015-07-20 14:55 UTC, John Miller [MSFT]
Details


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 FIXED

Description John Miller [MSFT] 2015-07-20 14:45:46 UTC
**Overview:**

   After updating Xamarin.Forms from 1.4.3 to 1.4.4-pre2 in a PCL based solution, building will fail with the following message:

   > Error initializing task FixedCreateCSharpManifestResourceName: Not registered task FixedCreateCSharpManifestResourceName.

**Steps to Reproduce:**

   1. Create a new Solution -> Forms -> PCL app in Xamarin Studio on Mac
   2. Update the NuGet packages for Forms to 1.4.4-pre2 (Pre-release checkmark needed)
   3. Build the solution

**Actual Results:**

   > Error initializing task FixedCreateCSharpManifestResourceName: Not registered task FixedCreateCSharpManifestResourceName.

**Expected Results:**

   No errors.

**Build Date & Platform:**

   XS 5.9.4
   Mac OSX 10.10.2

**Additional Information:**

   Workaround: Restart Xamarin Studio or Reload the solution.
Comment 2 John Miller [MSFT] 2015-07-20 14:54:38 UTC
** Steps to Reproduce **

1. Run the attached sample on an iOS Simulator. 
2. I will build an run fine. 
3. Update the PCL and iOS Project to use Xamarin.Forms 1.4.4-pre3 from NuGet
4. Run the attached sample again on an iOS Simulator. 
5. It will fail at building until XS or the solution is unloaded.
Comment 3 John Miller [MSFT] 2015-07-20 14:55:00 UTC
Created attachment 12119 [details]
Test Case
Comment 4 Amalia 2015-07-28 14:27:30 UTC
I'm experiencing this issue in Forms 1.4.4.6387 (using the same attached test case).

Changing status to confirmed.
Comment 5 Joe Sauve 2015-07-28 16:32:26 UTC
I saw the same thing in an existing project as soon as I updated to 1.4.4 today.
Comment 6 Adrian Salazar 2015-07-28 18:21:56 UTC
I have the same problem today when upgrading to version 1.4.4.6387
Comment 7 RickTheHat 2015-07-28 21:41:52 UTC
Still having problems when upgrading to latest version 1.4.4.6391 of Forms & Forms.Maps
Comment 8 RickTheHat 2015-07-30 00:02:13 UTC
Still having problems when upgrading to latest version 1.4.4.6392 of Forms &
Forms.Maps
Comment 9 toddkrokowski 2015-07-30 09:32:14 UTC
Same problem here with v1.4.4.6392 while trying to compile an Android PCL project using the OS X Xamarin Studio IDE.
Comment 10 Leon 2015-07-30 12:08:10 UTC
Same as the others, as soon as I update to v1.4.4.6392 on a Simple XamForms PCL (Android Build) project I get the same error... have to do a roll-back otherwise I can't compile.
Comment 11 Brendan Zagaeski (Xamarin Team, assistant) 2015-07-30 14:01:29 UTC
## Workaround

For anyone hitting this issue, note the workaround mentioned in comment 0:

> Restart Xamarin Studio or Reload the solution.
Comment 12 RickTheHat 2015-07-31 09:24:10 UTC
DOH
Comment 13 toddkrokowski 2015-07-31 21:55:51 UTC
Workaround does not work for me, I had to roll back to 1.4.3 and that unfortunately breaks my application due to another bug.
Comment 15 Matt Ward 2015-08-11 13:51:46 UTC
The problem is to do with the MSBuild host having the wrong MSBuild task loaded and not being restarted after the Xamarin.Forms NuGet package is updated.

Each project in a solution has a reference to this separate MSBuild host process. A solution will have a single MSBuild host process. When a project is compiled then the MSBuild host will load the Xamarin.Forms.Build.Tasks.dll. In order for the MSBuild host to be able to use a different Xamarin.Forms.Build.Tasks.dll the MSBuild host process needs to be restarted.

Triggering a restart of the MSBuild host process is done by the NuGet addin, when it detects an MSBuild targets file is removed from a project. However the NuGet addin does not directly restart the host process but causes the project to remove its reference to the MSBuild host. When the reference count goes to zero the MSBuild host process is stopped. This works if the solution contains only one project or only a single project was compiled, but when there are multiple projects the MSBuild host process is not stopped so the old Xamarin.Forms.Build.Tasks.dll is still being used.

A fix is to have the NuGet addin go to each project in the solution and ask it to remove its reference to the MSBuild host process. Currently it only does this for the single project being updated. A similar procedure happens when the solution is closed - each project's reference to the build host is removed and the MSBuild host process will be stopped once the reference count goes to zero.

So if there is the same build error about a missing FixedCreateCSharpManifestResourceName task after closing and reopening the solution, or restarting the Xamarin Studio, then that suggests that one of the projects in the solution is still using an old version of the Xamarin.Forms.Build.Tasks.dll so it is probably worth checking the .csproj files to ensure the correct Xamarin.Forms.targets file is being imported by each project.
Comment 17 xamarin-release-manager 2015-08-13 12:48:48 UTC
Fixed in version 5.10.0.550 (master)

Author: Matt Ward
Commit: 053dbac10e7c106b52f34ee35161b63a29842ae3 (mono/monodevelop)