This is a migrated thread and some comments may be shown as answers.

Sybase ASA12 DataModel Creation Fails

9 Answers 161 Views
Design Time (Visual Designer & Tools)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Giovanni Pulvirenti
Top achievements
Rank 1
Giovanni Pulvirenti asked on 05 Jan 2011, 04:14 PM
Hi,
I'm starting a new C# project using OpenAccess ORM with VS2010 and Sybase 12 as backend.
I'm now experiencing a strange wizard behavior immediately after the connection string building (the test works perfectly).
When ORM tries to read database schema I receive this error message from VS2010:

Connection error, ExceptionSystem.IO.FileNotFoundException, Details:Unable to load file or assembly 'iAnywhere.Data.SQLAnywhere, Version=10.0.1.34152, Culture=neutral, PublicKeyToken=f222fc4333e0d400' or one of its relative dependencies. Unable to find the specified file.


If I correctly understand, ORM (?, or something other) is searching for ASA10 data provider assembly. Really don't understand why..

This is the iAnywhere.Data.SQLAnywhere.config file content:
<configuration>
    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <dependentAssembly>
                <assemblyIdentity
            name="iAnywhere.Data.SQLAnywhere"
            publicKeyToken="f222fc4333e0d400"
            culture="neutral"
        />
                <bindingRedirect
            oldVersion="12.0.0.0-12.0.0.24832"
            newVersion="12.0.0.24832"
        />
            </dependentAssembly>
        </assemblyBinding>
    </runtime>
</configuration>

Maybe do I have to write some other binding redirect somewhere?

Thanks in advance for any help.

9 Answers, 1 is accepted

Sort by
0
Giovanni Pulvirenti
Top achievements
Rank 1
answered on 05 Jan 2011, 04:41 PM
Just and additional information: I've successfully created a data model using VS2010 MS Entity Framework. I haven't found any dll mismatch error.

Thanks again.
0
Thomas
Telerik team
answered on 06 Jan 2011, 10:00 AM
Hi Giovanni Pulvirenti,

our code was linked with version 10.0.1.34152, and therefore such a version is needed. However, as you have already found out, with an assembly binding redirect, this should work with newer versions too.

<configuration
    <runtime
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"
            <dependentAssembly
                <assemblyIdentity 
                    name="iAnywhere.Data.SQLAnywhere" 
                    publicKeyToken="f222fc4333e0d400" 
                    culture="neutral" /> 
                <bindingRedirect 
                oldVersion="10.0.0.0-12.0.0.24832" 
                newVersion="12.0.0.24832" /> 
            </dependentAssembly
        </assemblyBinding
    </runtime
</configuration>

Hope this solves the issue,

 

 

Thomas
the Telerik team
Accelerate your learning with industry's first Telerik OpenAccess ORM SDK. Download today.
0
Giovanni Pulvirenti
Top achievements
Rank 1
answered on 07 Jan 2011, 10:27 AM
Hi Thomas,
thanks for your answer. However, it seems that there isn't any change on the connection behavior. ORM is still requesting version 10.0.1.34152 of "iAnywhere.Data.SQLAnywhere". I think I'm wrong again. I modified the ASA config file for .Net Framework 3.5
This file is located under "<Sybase Installation Path>\Assembly\V3.5" and its name is "iAnywhere.Data.SQLAnywhere.v3.5.config".
This is how is at the moment:
<configuration>
    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <dependentAssembly>
                <assemblyIdentity
            name="iAnywhere.Data.SQLAnywhere"
            publicKeyToken="f222fc4333e0d400"
            culture="neutral"
        />
                <bindingRedirect
            oldVersion="10.0.0.0-12.0.0.24833"
            newVersion="12.0.0.24833"
        />
            </dependentAssembly>
        </assemblyBinding>
    </runtime>
</configuration>

After this change, I've launched again "SetupVSPackage.exe", Sybase command line program to correctly configure VS; but nothing is changed.
Is it mandatory to have installed the Sybase version 10.0.1.34152? How this will influence the deploy? Must both 10 and 12 Sybase version be installed on customer server?

Thanks in advance.
0
Giovanni Pulvirenti
Top achievements
Rank 1
answered on 07 Jan 2011, 11:43 AM
There are some updates about this problem.
I've installed iAnywhere version 10.1 (with EBF#4157) and now I still not receive the error about the misusing of the dll.
But there is another error message:
"Error: System.IndexOutOfRangeException: Index was outside the bounds of the array"
I've selected ".NET Framework Data Provider for SQL Anywhere 12" and used a simple connection string relaying to an ODBC data source name: "datasourcename=myDataSourceName".

My suspect is that ORM is still using Sybase v.10.x data provider even if is selected v.12.

So, I've used a "manual" connection string, that is:
Provider=SAPROV.12;Server=myServer;DBN=myDatabasename;UID=DBA;PWD=myPwd;InitString=SET TEMPORARY OPTION CONNECTION_AUTHENTICATION='Company=MyCompany;Application=Infinity;Signature=00000000000000000000000';

Note that, as we are Sybase OEM vendor, there is a new connection string style to apply. That is a temporary option in which must be indicated the company, the application and the relative signature.

After applying this connection string, I receive this error:
"Connection error, ExceptionSystem.ArgumentException, Details:Invalid connection string. Error parsing connection parameter string"

This enforces my suspect: ORM still using Sybase v.10.x data provider.

ORM specifics are clear: it supports Sybase iAnywhere v.12 (http://www.telerik.com/help/openaccess-orm/getting-started-root-dbsupport-sql-anywhere.html), so I think I'm not the first who encounters this problem. Have you a workaround?
This is a very important project; we have to expose as WCF services very critical functionalities of our application for all over the Country.

Thank you very much.


0
Thomas
Telerik team
answered on 10 Jan 2011, 04:54 PM
Hi Giovanni Pulvirenti,

I just verified, that I can locally use the Version 12 of the driver from OpenAccess that was compiled with Version 10. I do have a policy.12.0.iAnywhere.Data.SQLAnywhere assembly in my GAC, is that present on your side too? I also verified (with a console app) that the assemblyBinding works correctly. I saw however, that the newVersion needs to be 24832 for me, as I don't have a 24833 version here.
The InitString is (at least in the 24832 version) not part of the connection string, but needs to be given through the BackendConfiguration of your generated Context class. What I have here is:

 public static BackendConfiguration GetBackendConfiguration()
{
BackendConfiguration backend = new BackendConfiguration();
backend.Backend = "sqlanywhere";
 backend.ConnectionPool.InitSQL.Add("SET TEMPORARY OPTION CONNECTION_AUTHENTICATION='Company=MyCompany;Application=Infinity;Signature=00000000000000000000000'");
return backend;
}

OpenAccess does not use different versions of the provider, but we compile/link with one version. We/You need to make sure that this version is correctly redirected. The two principal ways to do this are configuration of the runtime (as done  in the app.config / web.config) or to have a policy file that does the redirection. The runtime configuration must be done for all processes (it is process-specific), whereas the policy change (in the GAC) would allow redirection of all processes.

Kind regards,
Thomas
the Telerik team
Accelerate your learning with industry's first Telerik OpenAccess ORM SDK. Download today.
0
Giovanni Pulvirenti
Top achievements
Rank 1
answered on 10 Jan 2011, 06:46 PM
Hi Thomas,
first of all thank you for you help. it is very appreciated.
You wrote:
"I do have a policy.12.0.iAnywhere.Data.SQLAnywhere assembly in my GAC, is that present on your side too?"

Sure, i have it too (v. 12.0.0.24832).
I cannot achieve a test application (even if a simple console application); that's because I cannot generate any (schema first) model.

Ok for the "InitString" tip; I will try after I will have a Data Model :-)

Regarding the version of iAnywhere.Data.SQLAnywhere: there are 3 different assemblies:
  • iAnywhere.Data.SQLAnywhere.dll v.12.0.0.24832, suitable for .Net Framework 2 (it resides under <SQL install path>\Assembly\V2)
  • iAnywhere.Data.SQLAnywhere.v3.5.dll v.12.0.0.24833, suitable for .Net Framework 3.5  (it resides under <SQL install path>\Assembly\V3.5)
  • iAnywhere.Data.SQLAnywhere.v4.0.dll v.12.0.0.24834, suitable for .Net Framework 4  (it resides under <SQL install path>\Assembly\V4)
I've made up 3 different console application projects, using  all these 3 assemblies with their respective binding configuration (in app.config) .. but nothing. Always the same problem.

But.. I have not "policy.12.0.iAnywhere.Data.SQLAnywhere.v4.0.dll" in the GAC and I am not able to install it (dragging it onto the GAC folder).
I suspect some critical scenario on my GAC after too many iAnywhere install/uninstall.

I will try to uninstall all (any Sybase version and ORM too), then I will refer to the GAC to be sure that isn't any trace of the previous installation; finally I will install all again and will report it.

I opened a new support ticket (id #382538) where I have attached two screenshots.
Where will I have to report next steps?

Thanks again.
0
Thomas
Telerik team
answered on 11 Jan 2011, 08:21 PM
Hi Giovanni Pulvirenti,

please use the support ticket for further communication; it's easier to attach files there. 

All the best,
Thomas
the Telerik team
Accelerate your learning with industry's first Telerik OpenAccess ORM SDK. Download today.
0
David
Top achievements
Rank 1
answered on 29 Apr 2013, 05:55 PM
I am having the same problem. How can I find the resolution once you tell the poster to "use the support ticket for further communication"? He's right, he is not the only one having this problem.
0
Ivailo
Telerik team
answered on 30 Apr 2013, 06:32 AM
Hi David,

Our usual practice is to post an answer in the forum thread once the issue is resolved. However, in this case we have not received any further information on  the issue, so we haven't published any solution.

Could you share some further information on the issue in a support ticket? I will make sure we post information in this thread once we know what is causing the problem.


All the best,
Ivailo
the Telerik team
Using Encrypted Connection Strings with Telerik OpenAccess ORM. Read our latest blog article >>
Tags
Design Time (Visual Designer & Tools)
Asked by
Giovanni Pulvirenti
Top achievements
Rank 1
Answers by
Giovanni Pulvirenti
Top achievements
Rank 1
Thomas
Telerik team
David
Top achievements
Rank 1
Ivailo
Telerik team
Share this question
or