2

after an upgrade to Visual Studio 2015 my AppFabric client hosted in a windows service does not start up anymore. An exception is thrown from the DataCacheFactory constructor when the service starts and the factory is encapsulated inside a Cache singleton class. here's the exception.

8/4/2015 9:51:47 PM Service start error: System.TypeInitializationException: The type initializer for 'ioService.IoService' threw an exception. ---> Microsoft.ApplicationServer.Caching.DataCacheException: ErrorCode:SubStatus:There is a temporary failure. Please retry later. (One or more specified Cache servers are unavailable, which could be caused by busy network or servers. Ensure that security permission has been granted for this client account on the cluster and that the AppFabric Caching Service is allowed through the firewall on all cache hosts. Retry later.) at Microsoft.ApplicationServer.Caching.ClientDRM.InitializeCasClient(String id, TimeSpan chnlOpenTimeout) at Microsoft.ApplicationServer.Caching.DataCacheFactory.InitDrm() at Microsoft.ApplicationServer.Caching.DataCacheFactory..ctor(DataCacheFactoryConfiguration configuration) at ioService.Cache..ctor()

When putting the old Visual Studio 2013 generated assemblies back it starts up again and not a single line of code is different!! Just double checked, the config files are also exactly the same.

I've really no clue what to do anymore and since information on appfabric is not uhm....widely available I'm asking here. Has anybody experienced the same thing?

here's the code if that helps:

internal class Cache
    {
        private static volatile Cache mCache = null;
        private static object SyncRoot = new object();

        private DataCache mArticleCache;
        // FAULTING INSIDE CONSTRUCTOR...
        private DataCacheFactory mCacheFactory = new DataCacheFactory();

        public static Cache Instance
        {
            get
            {
                if (mCache == null)
                {
                    lock (SyncRoot)
                    {
                        if (mCache == null) // search DCLP for why 2x if
                            mCache = new Cache();
                    }
                }
                return mCache;
            }
        }

        public DataCache ArticleCache
        {
            get { return mArticleCache; }
        }

        private Cache()
        {
            mArticleCache = mCacheFactory.GetCache(ConfigurationManager.AppSettings["Cache.ArticleCacheName"]);

            try
            {
                mArticleCache.CreateRegion(ConfigurationManager.AppSettings["Cache.ArticleRegionName"]);
            }
            catch (DataCacheException dcex)
            {
                if (dcex.ErrorCode != DataCacheErrorCode.RegionAlreadyExists)
                    throw dcex;
            }
        }
    }

update: After turning on tracing at the appfabric service level the Microsoft service trace viewer shows the following error:

enter image description here

The maxOutboundConnectionsPerEndpoint is likely too low. How does one go about changing this number within AppFabric?

update 2

The project files are different. This the old section for appfabric

     <Reference Include="Microsoft.ApplicationServer.Caching.Client">
<HintPath>..\..\..\..\temp\AppFabric\Microsoft.ApplicationServer.Caching.Client.dll</HintPath>
        </Reference>
        <Reference Include="Microsoft.ApplicationServer.Caching.Core">
<HintPath>..\..\..\..\temp\AppFabric\Microsoft.ApplicationServer.Caching.Core.dll</HintPath>
        </Reference>

And the new section

   <Reference Include="Microsoft.ApplicationServer.Caching.Client, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\..\..\..\temp\AppFabric\Microsoft.ApplicationServer.Caching.Client.dll</HintPath>
    </Reference>
    <Reference Include="Microsoft.ApplicationServer.Caching.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\..\..\..\temp\AppFabric\Microsoft.ApplicationServer.Caching.Core.dll</HintPath>
    </Reference>

Version and publickeytoken is included now and the SpecificVersion false tag is added.

Serve Laurijssen
  • 9,266
  • 5
  • 45
  • 98

0 Answers0