+1-888-365-2779
Try Now
More in this section

Forums / Set-up & Installation / Need help getting up and running with OpenAccess

Need help getting up and running with OpenAccess

13 posts, 0 answered
  1. Sean Haddy
    Sean Haddy avatar
    13 posts
    Registered:
    14 Dec 2009
    07 Jan 2010
    Link to this post
    Hello all,

    Well, I've been looking at OpenAccess, and it looks like a very significant upgrade for Sitefinity, I'm excited to work with 4.0...

    Anyways, I'm having trouble getting OpenAccess running in my current Sitefinity project. I am currently running 3.7.2057 on my local IIS without a hitch. One issue I've run into though (using Visual Studio 2010 beta), is it defaults my class creation to .NET 4.0... not a huge deal, I just change the target framework to 2.0.

    I've followed the full tutorial posted (from start to finish) by my new found friend Gabe Sumner here: Open Access Tutorial

    The problem is, even if I change the target framework to 2.0, it still throws a message:


    Could not load file or assembly 'MyClass' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.


    When I first added the class to the library (at the 4.0 level) it asked me if I wanted to update my website project to use the newest framework... should I have done that? How do I get around this? I really want to start using Open Access now, so I can be up and running with the toolset when 4 is released. What Framework is Sitefinity 4 set to utilize? 3.5?

    Thanks,

    -Haddy
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    07 Jan 2010
    Link to this post
    Hello Sean Haddy,

    It seems that the enhancer that runs  is producing .NET 4.0 assemblies or different version of the .NET dlls. You could try using post build event to start the enhancer:
    "c:\programs files\telerik\openaccess orm\sdk\venhance.exe" "-assembly:$(TargetPath)"

    Try replacing the path and set the event to 'when the build updates the project output'. You can also use the OpenAccess targets file http://www.telerik.com/help/openaccess-orm/openaccess-msbuild-integration.html

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Sean Haddy
    Sean Haddy avatar
    13 posts
    Registered:
    14 Dec 2009
    07 Jan 2010
    Link to this post
    I'm having trouble finding where to put this post build event...
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    07 Jan 2010
    Link to this post
    Hi Sean Haddy,

    You can take a look at the following articles

    Working with OpenAccess
    The OpenAccess ORM Enhancer

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  5. Sean Haddy
    Sean Haddy avatar
    13 posts
    Registered:
    14 Dec 2009
    07 Jan 2010
    Link to this post
    [no longer applicable]
  6. Sean Haddy
    Sean Haddy avatar
    13 posts
    Registered:
    14 Dec 2009
    07 Jan 2010
    Link to this post
    [no longer applicable]
  7. Sean Haddy
    Sean Haddy avatar
    13 posts
    Registered:
    14 Dec 2009
    07 Jan 2010
    Link to this post
    Alright, I read the tutorial wrong, post build actions are to be added to the class. I added the post build action as noted, and it exits with error code 3.

    Error   1   The command ""c:\programs files\telerik\openaccess orm\sdk\venhance.exe" "-assembly:C:\Users\SHaddy.JENSONUSA\Documents\Visual Studio 2010\Projects\MyClass2\MyClass2\bin\Debug\MyClass2.dll"" exited with code 3.  MyClass2 
     

  8. Sean Haddy
    Sean Haddy avatar
    13 posts
    Registered:
    14 Dec 2009
    07 Jan 2010
    Link to this post
    This still isn't working... The previous error is shown on compilation of the class.
  9. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    07 Jan 2010
    Link to this post
    Hi Sean Haddy,

    Make sure that the path to venhance is complete and correct.  To build a real path that is relative to your solution, you can use the standard variable ($SolutionDir) and make the path to use this as a base for relativity.
    Make sure that you have copied Teleril.OpenAccess.dll  to the folder where the venhance.exe is.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  10. Sean Haddy
    Sean Haddy avatar
    13 posts
    Registered:
    14 Dec 2009
    07 Jan 2010
    Link to this post
    Ivan,

    Thank you for your help, I keep running into problems though :(...

    Now its saying:

    The 'openaccess' section cannot be found in the application's configuration file.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: Telerik.OpenAccess.Exceptions.ConfigurationException: The 'openaccess' section cannot be found in the application's configuration file.


    IObjectScope newScope = db.GetObjectScope();
    

    In my reference lib, only Telerik.OpenAccess.Query.dll shows, not Teleril.OpenAccess.dll ... is this a problem? I originally added both but just that one shows up. Within the sdk folder I have made sure Telerik.OpenAccess.Query.dll was in there.

    -Haddy
  11. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    08 Jan 2010
    Link to this post
    Hi Sean Haddy,

    Please take a look at the articles listed below

    Support for Dynamically Loaded assemblies
    Configuration File Format
    Telerik OpenAccess ORM - Overview

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  12. Sean Haddy
    Sean Haddy avatar
    13 posts
    Registered:
    14 Dec 2009
    08 Jan 2010
    Link to this post
    That must be the problem... I looked at my web.config file, and it doesn't even contain the declarations for those two sections within the file. I wonder why these aren't generating via the wizard? Seems like a lot of work to do for something that should be pretty straight forward. I hope this will be fixed in the future.
  13. Sean Haddy
    Sean Haddy avatar
    13 posts
    Registered:
    14 Dec 2009
    08 Jan 2010
    Link to this post
    Well, after being very frustrated and coming close to not using OpenAccess, I decided to try it on another PC with VS2008 installed and the tutorial worked fine. I'm going to continue working to see whats different with the two implementations and update here if I find anything.
Register for webinar
13 posts, 0 answered