0
votes

We're migrating Azure application to on-premise data-centres. When deploying to Azure package to Cloud services we need to use Azure in Role Cache. When deploying to Windows Server on-premise we need to use Windows Server AppFabric Cache. How do you make it work in one solution?

Detailed explanation

We connect to Azure in Role Cache with Azure SDK v 2.2 client assemblies.

Microsoft.ApplicationServer.Caching.Client.dll, assembly version 1.0.0.0, file version 1.0.5137.0
Microsoft.ApplicationServer.Caching.Core, assembly version 1.0.0.0, file version 1.0.5137.0

We connect to Windows Server AppFabric Cache v 1.1 using client assemblies that came with instalation.

Microsoft.ApplicationServer.Caching.Client.dll, assembly version 1.0.0.0, file version 1.0.4632.0
Microsoft.ApplicationServer.Caching.Core, assembly version 1.0.0.0, file version 1.0.4632.0

Assemblies visioning issues are addressed in Windows Server AppFabricCache, Exception, Check the client version thread.

Issue is that our main web project ends up with references to all mentioned assemblies which have duplicate names and versions. We wouldn't like to hack our way thru it. Options from the worst to not so bad are to create custom assembly loading or to modify build process. What's the preferred way? Have we strayed from the path big time?

2

2 Answers

1
votes

You cannot use both azure SDK libraries and on-premise libraries in the same project for cache. For on-premise, you need to use the client libraries found in installation folder and for in-role, the ones from azure SDK.

If the reason for your move is server and client being tied to the same project, I would suggest using managed cache, the new GA solution where you can use the same client you use for in-role with minimal config level changes to make it work. Here the server uptime SLA etc in managed by the service team itself so you don't have to bother about these.

If you want to completely move to on-premise, then yes, Appfabric for windows server is the best solution then. But generally I have seen websites which have traffic from all over the world benefitting from their azure solution for cache. But you would know your scenarios better :)

0
votes

You can use both azure SDK libraries and on-premise libraries in the same project for cache, but it's a hack. That means, not a good idea. Try to use Redis instead.

I'll continue with bad advice.

Two build configurations need to exist. One for Azure and another for on-prem. On-prem build process needs to be tempered with. For ex. add some msbuild xml or run some post build script that will replace Azure dlls that get deployed by default with on-prem dlls. Publish for on-prem needs to be tweaked too. Check out this pointer: AfterPublish target not working .