This is my situation. After installing SA 16 developer in my development machine I can connect to the database without any problems. I just add the reference to iAnywhere.Data.SQLAnywhere.v4.0 in my ASP .Net project (Visual Studio 2012) and everything is fine. Then when it is time to deploy I perform the following steps:
After deploying the application, each time it tries to connect to the database fails with this (simplified) error message:
System.TypeInitializationException: The type initializer for 'iAnywhere.Data.SQLAnywhere.SAConnection' threw an exception. at iAnywhere.Data.SQLAnywhere.SAConnection..ctor(String connectionString) at edu.southern.image_server.RetrievePersonPicture.WriteContent(Stream stream) caused by iAnywhere.Data.SQLAnywhere.SAException: Cannot find the language resource file (dblgen16.dll). at iAnywhere.Data.SQLAnywhere.SAUnmanagedDll.get_Instance() at iAnywhere.Data.SQLAnywhere.SAConnection..cctor()
Then I uninstall the client and install the developer's tool (without the server related stuff) and after it finishes the application just works fine. That to me says that the installer from the deployment tools is missing something, what that could be? I'm clueless at this point, and of course I don't want to install developer tools to each one of my production servers. What am I missing here?
Confine this similar question: Should deployment wizard update path and set SQLANY16?
As Jeff does explain there, the SA 16 Deployment Wizard currently seems to miss some PATH and registry entries, but you can add that yourself.
answered 24 Feb '14, 15:40
Since this is an ASP.NET deployment, see the discussion in this question (CC'ed below):
It looks like you're trying to use the ADO.NET provider from IIS (
If so, you may want to look at this related StackOverflow question that deals with the same issue (not specific to SQL Anywhere).
The first matching DLL with the correct bitness will be the DLL located for this operation. As mentioned in the above StackOverflow thread, you can set the path explicitly in your code, using:
System.Environment.SetEnvironmentVariable("Path", searchPath + ";" + oldPath)