n
nThis was one of the most strange issue I saw today and it is with Microsoft Azure Managed Cache Service APIs.
n
nWhat was the issue?
n
nWe were using Azure managed cache 2.3.1 APIs and everything was set including changes needed in the configuration files.
n
nHere is what typical snippet to initialize the cache factory looks like
n
nnn
n
n
n
n
nThe line 2 in above snippet was the issue. As soon as the compiler used to hit the line which actually initializes nthe DataCacheFactory object from config file – compiler never returned.
n
nIn the very first line of this post I mentioned a word strange because – the snippet above worked on each machine (windows 8 / windows 8.1) with no issues however there was a colleague of mine who was facing the problem who had exact same configuration as that of other machines.
nAdding more suspense to the scenario, this only didn’t work with the web application. When we tried creating a quick console application pointing to the same cache service on same machine – it worked. interesting the world of programming, isn’t it?
n
n What is the solution?
n
nWell, after long search on this, mostly found links about best practices of using DataCacheFactory class but nothing near the actual issue. At one point – started feeling that are we the ONLY guys in entire universe who are facing this real strange issue? but .. there is one thing you can keep doing and that is keep trying.. and we headed towards searching more on this by altering keywords here and there and then we found something
n
nfound a post of stackoverflow in which the guy described about exact same issue and solution too, but the real reason behind this error is still unknown to me ( or to the post owner too). If anyone knows – feel free to leave a comment.
n
n There are two components which you might find installed on your machine.i.e
n1. IIS Express Application Compatibility Database for x64 and
n2. IIS Express Application Compatibility Database for x86
n
nAll you need to do is, uninstall those, restart your visual studio and you are done.
n
n[Adding further notes which were not there in the post mentioned above]
nAfter this, if you start facing the error –
nSpecified argument was out of the range of valid values. parameter name site.
n
nDon’t get panic, simply install IIS on your local computer. Here is how you can do this
nOpen Control Panel > Turn Windows features on or off > Check Internet Information Services and click ok.
n
nRestart visual studio and you are good to go.
n
nHope this works for you and saves your efforts of searching solution for this strange issue.
n