3

Closed

Conflicts with Azure Caching Preview

description

<p>The Transient Fault Framework has references that break apps trying to use the Caching Preview...</p> <p>&nbsp;</p> <p>This assembly: </p> <p> Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling, Version=5.0.1118.0,...</p> <p>&nbsp;</p> <p>References this assembly:</p> <p> Microsoft.ApplicationServer.Caching.Core, Version=101.0.0.0...</p> <p>&nbsp;</p> <p>This screws up the inclusion of this assembly (from Caching Preview):</p> <p> Microsoft.ApplicationServer.Caching.Core, Version=1.0.0.0...</p> <p>&nbsp;</p> <p>Not sure why the Transient FaultHandling framework needs to access AppFabric Server Caching assemblies, but it seems like we might be missing an abstraction in there..</p>
Closed Aug 29, 2012 at 9:44 PM by
Fixed

comments

randylevy wrote Jul 24, 2012 at 5:32 PM

The Transient Fault Handling Application Block has retry logic for handling caching failures. The CacheTransientErrorDetectionStrategy class interrogates exception error codes against Microsoft.ApplicationServer.Caching.DataCacheErrorCode and Microsoft.ApplicationServer.Caching.DataCacheErrorSubStatus values.

Randy Levy

gmelnik wrote Aug 7, 2012 at 1:51 PM

This is expected when new versions of signed assemblies referenced by your assemblies become available. Assuming the newer version is backwards compatible, [url:assembly binding redirects|http://msdn.microsoft.com/en-us/library/2fc472t2(v=vs.100).aspx] can be added to the machine's or the application's configuration file to instruct the CLR to use the newer version instead of the referenced one.

Here's an example redirect from the specific version referenced by the Transient Fault Handling Application Block to the June 2012 version of the Caching.Core.

{{











}}

Of course if yet another new version becomes available in the future then the redirect needs to change. The nuget tool takes care of this at the application level when referenced assemblies come from other nuget packages, and installers usually add these redirects at the machine level. The Transient Fault Handling Application Block is available as a [url:nuget package|http://nuget.org/packages/EnterpriseLibrary.WindowsAzure.TransientFaultHandling].

gmelnik wrote Aug 7, 2012 at 1:54 PM

It appears Codeplex wiki markup doesn't apply to comments. Nor can I edit them. In my previous answer, please ignore {{ and }}.

wjchristenson2 wrote Aug 23, 2012 at 11:53 PM

I'm also facing this issue. I have both the Transient Fault Handling Application Block for Windows Azure and the Windows Azure Caching Preview installed using NuGet. I have the conflict warning occuring when building in VS. If you click the warning to resolve, it does not do anything.

I've manually added binding redirects in my web.config. However this does not remove the warning. Even with the binding redirects, the web application will occasionally fail with "Could not load file or assembly 'Microsoft.ApplicationServer.Caching.Core' or one of its dependencies." because I've specified to use 1.0.0.0 and it sometimes gets overwritten in the /bin with the 101.0.0.0 version and thus cannot find 1.0.0.0.

Anyone have a solution? I don't want to manually add references. I'd like to keep NuGet rollin' to keep my assemblies updated.

tommck wrote Aug 29, 2012 at 4:37 PM

So crazy... why the heck did they use "101.0.0.0" and then release something with the SAME name as 1.0.0.0 ???

gmelnik wrote Aug 29, 2012 at 6:50 PM

@tommck Agree. The versioning of Microsoft.ApplicationServer.Caching.Core is broken. We are working to rev Topaz to cope with this. Stay tuned. Hope to ship this week.

gmelnik wrote Aug 29, 2012 at 9:44 PM

net4 wrote Sep 6, 2012 at 5:28 AM

I'm having the same problem. Updated to the new version but the assembly does not change. It's version 5.0.1118.0

net4 wrote Sep 6, 2012 at 5:44 AM

After updating I keep having this error:

StackTrace: at Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling.Cache.CacheTransientErrorDetectionStrategy.IsTransient(Exception ex)
at Microsoft.Practices.TransientFaultHandling.RetryPolicy.ExecuteAction[TResult](Func1 func)
at GrooveChat.Service.Utils.CacheManager
1.GetByKey(String key, CacheRegion region)
at GrooveChat.Service.ChatAppService.ChatRequestManager_OnRemoveChatRequest(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at GrooveChat.Service.Utils.CacheManager1.RemoveCallback(String cache, String region, String key, DataCacheItemVersion version, DataCacheOperations ops, DataCacheNotificationDescriptor desc)
at Microsoft.ApplicationServer.Caching.Dispatcher.DispatchNonBulkNotification(List
1 list)
at Microsoft.ApplicationServer.Caching.Dispatcher.Dispatch()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

net4 wrote Sep 6, 2012 at 5:52 AM

Sorry, I paste just the stack trace, here comes the complete log:



An unhandled exception occurred and the process was terminated.

Application ID: /LM/W3SVC/1273337584/ROOT

Process ID: 3792

Exception: System.IO.FileLoadException

Message: Could not load file or assembly 'Microsoft.ApplicationServer.Caching.Core, Version=101.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

StackTrace: at Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling.Cache.CacheTransientErrorDetectionStrategy.IsTransient(Exception ex)
at Microsoft.Practices.TransientFaultHandling.RetryPolicy.ExecuteAction[TResult](Func1 func)
at GrooveChat.Service.Utils.CacheManager
1.GetByKey(String key, CacheRegion region)
at GrooveChat.Service.ChatAppService.ChatRequestManager_OnRemoveChatRequest(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at GrooveChat.Service.Utils.CacheManager1.RemoveCallback(String cache, String region, String key, DataCacheItemVersion version, DataCacheOperations ops, DataCacheNotificationDescriptor desc)
at Microsoft.ApplicationServer.Caching.Dispatcher.DispatchNonBulkNotification(List
1 list)
at Microsoft.ApplicationServer.Caching.Dispatcher.Dispatch()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

randylevy wrote Sep 6, 2012 at 6:12 AM

@net4: Only the file version was incremented; the assembly version remained the same. See http://entlib.codeplex.com/wikipage?title=TopazAug2012UpdateReleaseNotes .

So you can check the file version or, if you are paranoid (like me :) ), use ILDASM to verify that the hard reference to Microsoft.ApplicationServer.Caching.Core is gone.

If you are still having issues post a full description of the scenario to the discussion forum.

net4 wrote Sep 6, 2012 at 6:21 AM

Yes, I'm paranoid too and allready checked it. Still throwing that exception.