Solution Requirements for Website

4 posts, 0 answers
  1. SuperXRAY
    SuperXRAY avatar
    82 posts
    Member since:
    Feb 2007

    Posted 18 Mar 2009 Link to this post

    I'm trying to figure out something that is bugging me about OpenAccess. From my experience, I can only use OA inside a Visual Studio ASP.NET Web Application. I cannot use OA inside a standard Visual Studio ASP.NET Web Site, which is the default VS template used when adding a Website to a Visual Studio Solution. Steps are below:

    1. Create a blank VS Solution.
    2. Add something like a BusinessObjects (Class Library) project to the solution.
    3. Right click the solution, or use the menus, to add an ASP.NET Web Site. This IS NOT an ASP.NET Web Application, they are two entirely different templates inside VS. Add a Reference to the BO Layer.
    4. Enable the BO Layer to use OpenAccess ORM. Update config references.
    5. Try to enable the Web Site, but you can't until you add an ASP.NET Folder: App_Code to the Web Site.
    6. Once that is done, you can Enable the Web site to use OpenAccess ORM. It then creates the ObjectScopeProvider, but you can never see the OSP when using the OpenAccessDataSource. It simply tells you to "Compile or build the project". So, I can never use the data source inside my aspx pages, because it can never sees any classes or scope provider.

    When using the ASP.NET Web Application template, things work just fine. My problem is that when using the Web Application template, you do not see the code-behind files or the BIN directory in Solution Explorer, making navigation more difficult. The references to dll's appears to be different as well, sometimes hindering deploying the Web Site to a hosting provider.

    Any information on this?

  2. Jan Blessenohl
    Jan Blessenohl avatar
    707 posts

    Posted 19 Mar 2009 Link to this post

    Hi SuperXRAY,
    If you want to use the web site projects you have to have OpenAccess persistent classes inside a library project.

    OpenAccess does not use reflection, nevertheless we need some extra code for lazy loading and change tracking. This code is injected by the enhancer. Because the web site project has no real compile step we can not inject our code. This results into the restrictions.

    That the OSP is not visible to the wizard is a bug. We will fix that. At the moment the best solution is to just have a OSP in your BO or DAL project and use it from there. It is not necessary to have it in the web site project.

    Jan Blessenohl
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. DevCraft banner
  4. Mikael Kleinwort
    Mikael Kleinwort avatar
    22 posts
    Member since:
    May 2004

    Posted 08 Aug 2009 Link to this post

    I just lost hours trying to get OpenAccess working in a quick and dirty test web site until I realized that it only works in a library project.

    I just feedback this to encourage you to fix the bug in the wizards. They shoudl tell me this... also I found no obvious reference to this simple fact in the quick start guides.

    Regards, Mikael
  5. Alexander
    Alexander avatar
    727 posts

    Posted 12 Aug 2009 Link to this post

    Hello Mikael Kleinwort,

    We are sorry for the inconvenience caused. The fix for the wizard bug, as well as the missing documentation information, are on our list and should be available in the next releases.

    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top