I have a single solution that consists of the following:
Custom Timer Job (WebApplication scoped)
Custom Content Type and List (Web scoped)
Custom Logging Area (Web scoped)
These features are set to not automatically activate on anything but Central Administration. When debugging, if I retract the solution and attempt to redeploy it, I get:
Failed to load receiver assembly "Nauplius.ADLDS.UserProfiles, Version=184.108.40.206, Culture=neutral, PublicKeyToken=6234e7e34f29e39a" for feature "Nauplius.ADLDS.UserProfiles_LoggingFeature" (ID: 0b1ba53c-8664-42fc-a01d-de60cb3e32b7).: System.IO.FileNotFoundException: Could not load file or assembly 'Nauplius.ADLDS.UserProfiles, Version=220.127.116.11, Culture=neutral, PublicKeyToken=6234e7e34f29e39a' or one of its dependencies. The system cannot find the file specified. File name: 'Nauplius.ADLDS.UserProfiles, Version=18.104.22.168, Culture=neutral, PublicKeyToken=6234e7e34f29e39a'
My understanding is that this is due to the OWSTIMER service needing to be restarted. Is there a work around here? For what its worth, the assembly is still in the GAC. Once debugging is stopped, the assembly is removed (but not the assembly's folder, which is interesting).
However, let's say I'm done with debugging, package the solution, the GAC is empty. If I then deploy it via PowerShell, I get the same error about the missing assembly. Even recycling the OWSTIMER service at this point will not resolve the issue. Instead the only solution I've found is to increment the assembly version and redeploy (not very practical).
When it partially deploys, it unfortunately leaves some of the other features behind. Because the solution deployment is in an error state, I have to use Feature Admin to forcefully remove the List feature of my solution.
How can I resolve this deployment issue for my custom timer job?
Fusion log on assembly bind failure:
*** Assembly Binder Log Entry (5/7/2012 @ 7:19:52 PM) *** The operation failed. Bind result: hr = 0x80070002. The system cannot find the file specified. Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework64\v2.0.50727\mscorwks.dll Running under executable C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN\OWSTIMER.EXE --- A detailed error log follows. === Pre-bind state information === LOG: User = NAUPLIUS\s-sp2010farm LOG: DisplayName = Nauplius.ADLDS.UserProfiles, Version=22.214.171.124, Culture=neutral, PublicKeyToken=6234e7e34f29e39a (Fully-specified) LOG: Appbase = file:///C:/Program Files/Common Files/Microsoft Shared/Web Server Extensions/14/BIN/ LOG: Initial PrivatePath = NULL LOG: Dynamic Base = NULL LOG: Cache Base = NULL LOG: AppName = NULL Calling assembly : Microsoft.SharePoint, Version=126.96.36.199, Culture=neutral, PublicKeyToken=71e9bce111e9429c. === LOG: This bind starts in default load context. LOG: Using application configuration file: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN\OWSTIMER.EXE.Config LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v2.0.50727\config\machine.config. LOG: Post-policy reference: Nauplius.ADLDS.UserProfiles, Version=188.8.131.52, Culture=neutral, PublicKeyToken=6234e7e34f29e39a LOG: The same bind was seen before, and was failed with hr = 0x80070002. ERR: Unrecoverable error occurred during pre-download check (hr = 0x80070002).