LinkCommerce Using Directive

Feb 24, 2009 at 1:06 AM
Hi, I am having trouble picking up the LinqCommerce using directive in the setup. I am using Visual Studio 2008 SP1. I am not used to using Website projects (I have always used WAP in the past) so that may be my problem. Also, I am using Sitefinity 3.6. Apart from that,I think I have followed your instructions correctly and have double checked the web.config additions. I set up a blank Sitefinity project called ECommerce and added the LinqCommerce files to the Sitefinity directory. Here is the error page:

Server Error in '/telerik/ECommerce' Application.
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0246: The type or namespace name 'LinqCommerce' could not be found (are you missing a using directive or an assembly reference?)

Source Error:

Line 3:  using System.Linq;
Line 4:  using System.Web.UI.WebControls;
Line 5:  using LinqCommerce;
Line 6:  using Telerik.Web.UI;
Line 7:  using System.Web.UI;

Source File: c:\inetpub\wwwroot\ECommerce\UserControls\ECommerce\LinqShoppingCart.ascx.cs    Line: 5

Many Thanks,

Shane
Feb 24, 2009 at 1:12 AM
Sorry, I forgot to mention, I got this error when I tried to add the ShoppingCart control to a page. Subsequently when I tried to build the website in Visual Studio I noticed that the LinqCommerce namespace could not be found for any of the classes that reference it.
Coordinator
Feb 24, 2009 at 1:54 PM
Hi,

I am sorry about that error. Please remove the using LinqCommerce line from the shopping cart file and let me know if the error persists. At the time, I was using made .cs files in the App_Code folder, which shall be combined into one file for LinqCommerce 2.7 and probably be compiled (source code shall be included), and I think that line is from one of those old files.
Feb 24, 2009 at 3:29 PM
Edited Feb 24, 2009 at 3:35 PM
Thanks very much for the quick reply Joe. That leads on to other errors however. I tried to build the website and I got 66 errors. The user control code can't seem to reference the classes in the App_Code folder. Here is a sample of the errors (Error 1 being the error I get in the browser when I removed 'using LinqCommerce' from the LinqShoppingCart.ascx.cs file):

Error    1    The name 'LinqShoppingCartAccess' does not exist in the current context    C:\Program Files\Telerik\Sitefinity3.6\WebSites\ECommerce\Sitefinity\LINQControls\ControlTemplates\LinqShoppingCart.ascx.cs    24    20    C:\...\ECommerce\

Error    4    The name 'LinqProductAccess' does not exist in the current context    C:\Program Files\Telerik\Sitefinity3.6\WebSites\ECommerce\Sitefinity\LINQControls\ControlTemplates\LinqShoppingCart.ascx.cs    72    9    C:\...\ECommerce\

Error    5    The type or namespace name 'BalloonShopDataContext' could not be found (are you missing a using directive or an assembly reference?)    C:\Program Files\Telerik\Sitefinity3.6\WebSites\ECommerce\Sitefinity\LINQControls\ControlTemplates\LinqShoppingCart.ascx.cs    78    9    C:\...\ECommerce\

Error    7    The type or namespace name 'Order' could not be found (are you missing a using directive or an assembly reference?)    C:\Program Files\Telerik\Sitefinity3.6\WebSites\ECommerce\Sitefinity\LINQControls\ControlTemplates\LinqShoppingCart.ascx.cs    81    9    C:\...\ECommerce\

Error    10    The type or namespace name 'ShoppingCart' could not be found (are you missing a using directive or an assembly reference?)    C:\Program Files\Telerik\Sitefinity3.6\WebSites\ECommerce\Sitefinity\LINQControls\ControlTemplates\LinqShoppingCart.ascx.cs    100    18    C:\...\ECommerce\

Error    11    The type or namespace name 'OrderDetail' could not be found (are you missing a using directive or an assembly reference?)    C:\Program Files\Telerik\Sitefinity3.6\WebSites\ECommerce\Sitefinity\LINQControls\ControlTemplates\LinqShoppingCart.ascx.cs    103    13    C:\...\ECommerce\
Coordinator
Feb 26, 2009 at 1:35 AM
Hi,

I am sorry to hear that you are still having issues with my project.

Likely, you are missing the classes in your App_Code folder. One in particular is SectionConfiguration.cs and that has a name space called LinqCommerce, which deals with all those properties I added in the Web.config. Please confirm that you copied all of the files in the App_Code folder into the App_Code folder of your application (if you don't have this folder, just copy the one from the zip file in there) Please add in that LinqCommerce reference into the shopping cart too. Let me know if the error persists.
Feb 26, 2009 at 8:52 AM
Thanks Joe, that was it. I had copied all the files from LinqCommerce into the Sitefinity folder, but I hadn't dragged the App_Code folder from the sitefinity folder up into the main project directory. You may want to specifically mention this in your installation guide for people like me who aren't used to working with VS Website projects. Thanks again.
Coordinator
Feb 27, 2009 at 10:43 PM
Hi,

Thanks for the heads up and I am glad that this solved your issue. I'll be sure to mention this. I have improved the business logic layer tremendously for the next release of LinqCommerce, which shall be version 2.65. By the way, what do you think of LinqCommerce? Any features or improvements you'd like to see?