deployment with sqlite

8 posts, 0 answers
  1. Galin
    Galin avatar
    7 posts
    Member since:
    Aug 2013

    Posted 27 Sep 2013 Link to this post

    Hi,
    I'm trying to figure out how to properly deploy the sqlite dependencies for my solution which consists of two projects: Sklad.Data and Sklad.UI. The first one is a dll, obviously containing the model. In it's App.Config the connection string is defined as an absolute path using System.Data.SQLite as provider(I have VS2012 and sqlite .net 4.0 installed on my machine, as I'm targeting .net 4.0 client profile). It was automatically created by the OA visual tool. As for the Sklad.UI's App.Config I have my connection string defined with |DataDirectory|.
    I've setup OA's dll to be 'Copy Local' but how do I setup a static reference to sqlite's dlls, so that I can deploy them along with my app?
    Thanks
  2. Boris Georgiev
    Admin
    Boris Georgiev avatar
    190 posts

    Posted 02 Oct 2013 Link to this post

    Hello Galin,

    If I have understood correctly your scenario, you want to deploy a Telerik OpenAccess ORM with SQLIte on a machine without installing it. In addition to the OpenAccess libraries you should also integrate the OpenAccess Enhancer tool in the solution. OpenAccess Enhancer reads and processes compiled .NET assemblies for adding persistence capability and the enhancement must be executed on all assemblies containing persistence classes as part of the build process. Here is an article that describes How to: Use OpenAccess ORM Without Installing It. Also you can refer to this article for a short guidance, how to config SQLite with OpenAccess ORM to develop application.

    I hope that helps. In case you want to achieve something different, do not hesitate to get back to us and we will provide additional guidance.

    Regards,
    Boris Georgiev
    Telerik
    OpenAccess ORM Q3 2013 Beta is available for immediate download in your account. Get it now and play with the latest bits. See what's new >>
  3. DevCraft banner
  4. Galin
    Galin avatar
    7 posts
    Member since:
    Aug 2013

    Posted 02 Oct 2013 Link to this post

    Hello Boris,
    I followed the article you referred to. In addition I had to bringTelerik.OpenAccess.SDK.dll along in order for the project to compile. However I'm now getting an exception at runtime(on the dev machine):
    Telerik.OpenAccess.OpenAccessException: No metadata has been registered for class 'Sklad.Data.Batch, Sklad.Data, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. (This usually indicates, that either this class is not declared persistent or it is declared persistent but not enhanced.)..
    In addition I still don't understand where the reference to sqlite is added. Say I was to include it using nuget, would it get resolved simply by the dbprovider declared in xaml?
  5. Doroteya
    Admin
    Doroteya avatar
    502 posts

    Posted 07 Oct 2013 Link to this post

    Hello Galin,

    Generally, the error you are experiencing occurs when the post build process that OpenAccess ORM executes through its special tool OpenAccess Enhancer is not completed successfully. In order to resolve it, I would suggest to you the workflow described in this knowledge base article and to rebuild the project.

    Regarding the deployment of the sqlite assembly, a good approach is to either copy the files in the bin folder of the application or set Copy Local to True for the reference and to rebuild the solution.

    I hope this works. If you have additional questions or need further assistance, do not hesitate to get back to us.


    Regards,
    Doroteya
    Telerik
    OpenAccess ORM Q3 2013 Beta is available for immediate download in your account. Get it now and play with the latest bits. See what's new >>
  6. Galin
    Galin avatar
    7 posts
    Member since:
    Aug 2013

    Posted 10 Oct 2013 Link to this post

    Hello Doroteya,
    your suggestion did indeed fix the enhancer problem but simply adding the sqlite reference(via nuget) to my project results in the following exception(on the deployment machine) when trying to load sqlite:
    The located assembly's manifest definition does not match the assembly reference.
    In my opinion this is because OA is still looking for the dll from the GAC, that isn't installed on the deployment machine. But if that is the case then how do I set it to the one that is deployed along with my app?
  7. Doroteya
    Admin
    Doroteya avatar
    502 posts

    Posted 16 Oct 2013 Link to this post

    Hi Galin,

    Based on the provided information, I assume that there is no other version of the sqlite assembly on the deployment machine besides the one delivered with the application. If that is indeed the case, I would suggest to you two possible solutions - to re-add the reference in Solution Explorer or to apply an additional <startup> tag in the <configuration> section of the .config file.

    The first solution assumes that the sqlite assembly is deployed on the machine but the reference inside the solution is pointing to a place different then the one of the assembly. You can check if this is the case by opening the solution, selecting the reference and reviewing the value of the Path property in Properties Window. If the value does not match the actual path to the assembly, you can remove the reference and add it again from the correct place. You can safely rebuild the application after that.

    The second solution assumes the target framework of the application is higher than 2.0 and that prevents the usage of the System.Data.SQLite.dll file which is compiled against .NET Framework 2.0. In this case, you can still utilize the assembly but the following needs to be added in the <configuration> section of the .config file:
    <startup useLegacyV2RuntimeActivationPolicy="true">
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
    </startup>
    Once you do that, you can rebuild the solution.

    I hope this helps. I am looking forward to your feedback.


    Regards,
    Doroteya
    Telerik
    OpenAccess ORM Q3 2013 Beta is available for immediate download in your account. Get it now and play with the latest bits. See what's new >>
  8. Galin
    Galin avatar
    7 posts
    Member since:
    Aug 2013

    Posted 18 Oct 2013 Link to this post

    Hello again,
    After a series of tryouts based on your suggestions I still haven't managed to get a different result..So i was wondering if you couldn't provide me with a ready-to-deploy sample using sqlite.
    Thanks,
    Galin
  9. Kristian Nikolov
    Admin
    Kristian Nikolov avatar
    206 posts

    Posted 23 Oct 2013 Link to this post

    Hi Galin,

    We are sorry to hear that your problem continues to persist. In order to request a sample, you can post a Resource Request at our feedback portal. Voting for it will help us prioritize its eventual implementation.

    Apart from the sample, what we usually do in case of a persisting deployment issue is providing a dedicated remote assistance session for locating the problem directly on the sever. For the time being this option is only available to our DevCraft Ultimate license holders.

    If you have any other questions, do not hesitate to use our forums again.


    Regards,
    Kristian Nikolov
    Telerik
    OpenAccess ORM Q3 2013 Beta is available for immediate download in your account. Get it now and play with the latest bits. See what's new >>
Back to Top
DevCraft banner