Sybase ASA12 DataModel Creation Fails

10 posts, 0 answers
  1. Giovanni Pulvirenti
    Giovanni Pulvirenti avatar
    12 posts
    Member since:
    Nov 2009

    Posted 05 Jan 2011 Link to this post

    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.
  2. Giovanni Pulvirenti
    Giovanni Pulvirenti avatar
    12 posts
    Member since:
    Nov 2009

    Posted 05 Jan 2011 Link to this post

    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.
  3. DevCraft banner
  4. Thomas
    Admin
    Thomas avatar
    590 posts

    Posted 06 Jan 2011 Link to this post

    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.
  5. Giovanni Pulvirenti
    Giovanni Pulvirenti avatar
    12 posts
    Member since:
    Nov 2009

    Posted 07 Jan 2011 Link to this post

    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.
  6. Giovanni Pulvirenti
    Giovanni Pulvirenti avatar
    12 posts
    Member since:
    Nov 2009

    Posted 07 Jan 2011 Link to this post

    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.


  7. Thomas
    Admin
    Thomas avatar
    590 posts

    Posted 10 Jan 2011 Link to this post

    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.
  8. Giovanni Pulvirenti
    Giovanni Pulvirenti avatar
    12 posts
    Member since:
    Nov 2009

    Posted 10 Jan 2011 Link to this post

    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.
  9. Thomas
    Admin
    Thomas avatar
    590 posts

    Posted 11 Jan 2011 Link to this post

    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.
  10. David
    David avatar
    1 posts
    Member since:
    Feb 2013

    Posted 29 Apr 2013 Link to this post

    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.
  11. Ivailo
    Admin
    Ivailo avatar
    318 posts

    Posted 30 Apr 2013 Link to this post

    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 >>
Back to Top
DevCraft banner