-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error on InitializeCache, problems getting started #49
Comments
I was able to resolve this by adding an "InstallDir" app setting. It looks like NCache is supposed to try to read this from I couldn't find any mention of the "InstallDir" setting in the documentation. |
Hi @palmsey NCache always looks in the application bin folder first for the "Client.ncconf" file and if it does not find it there then it will go search for it in the NCache installation directory at NCache/Config path in case of installation. The issue you are referring to is specific to web apps deployed in IIS server that always checks for config files from the "insetsrv" folder by default Here are some options you can try to resolve this in your environment, Option 1: You can use the CacheInitParams in your application when initializing the cache. This will take away any dependencies on client.ncconf file and you can control client side configurations programmatically. I am sharing more details on this below.
You can specify all client side properties that can be found with the documentation of the CacheInitParams class. Option 2: Here are steps that you can follow to read client.ncconf from a custom path when using Alachisoft Nuget package.
I hope this helps. |
@Kal-Alachisoft thanks. CacheInitParams may work for us, I will try that out. I would rather avoid modifying the registry on our servers and development machines. |
@Kal-Alachisoft I tried using CacheInitParams and removed my "InstallDir" app setting. I'm using the params in the InitializeCache call, like this:
When I run the application, I get an error on that line:
It seems like even when you specify CacheInitParams NCache is looking for the config file, and will throw an error if it can't find it. |
Hi @palmsey , the CacheInitParams removes that dependency completely and should not be referring to the config file at all. Please confirm are you still having this issue? |
Hi @Kal-Alachisoft, i'm using CacheInitParams in a ASP.NET MVC 5 project with sucess but in another project with WCF host service WEB i have the problem. |
Hi @palmsey, can you please share with us a working sample with which the issue is reproduced?. |
@palmsey copy the file there if it isn't there. |
When calling
NCache.InitializeCache("myCacheName")
in my ASP.NET project I'm getting this exception:An error occurred while reading client.ncconf. The type initializer for 'Alachisoft.NCache.Common.AppUtil' threw an exception.
Stack trace:
I've installed NCache 4.6.3 and the Open Source SDK NuGet package. The NCache service is running.
listcaches
shows I have a local cache running. I've tried editing permissions on client.ncconf to allow anyone to read/modify, both on the config file at the root of my web project and in the NCache installation folder. I've tried using the inproc cache "myCache" that is mentioned in the readme.txt that comes with the NuGet package too, but I keep getting the same error.What am I missing?
The text was updated successfully, but these errors were encountered: