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

Solution Requirements for Website

3 Answers 87 Views
Development (API, general questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
SuperXRAY
Top achievements
Rank 2
SuperXRAY asked on 19 Mar 2009, 02:31 AM
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?

Thanks,
Mitch

3 Answers, 1 is accepted

Sort by
0
Jan Blessenohl
Telerik team
answered on 19 Mar 2009, 11:14 AM
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.

Greetings,
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.
0
Mikael Kleinwort
Top achievements
Rank 1
answered on 08 Aug 2009, 11:38 AM
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
0
Alexander
Telerik team
answered on 12 Aug 2009, 07:52 AM
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.

Regards,
Alexander
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.
Tags
Development (API, general questions)
Asked by
SuperXRAY
Top achievements
Rank 2
Answers by
Jan Blessenohl
Telerik team
Mikael Kleinwort
Top achievements
Rank 1
Alexander
Telerik team
Share this question
or