C# and VB .NET Interface
Professional Edition


Installation

The C# and VB .NET interfaces consist of 7 files. The first 5 files can be found in the api\bin_redist directory.

To use the .NET interface you need to:

  1. Create a project in Visual Studio .NET.
  2. Add arulesnet.dll (from api\bin_redist) as a reference in your project.
  3. Add the existing file arulesxl.vb to your project's files.
  4. Put arulesrt.dll, ar_osutilsrt.lsx, ar_mysqlrt.lsx, arulesrt.xpl and arulesrt.cfg in a directory that is accessible to .NET and/or IIS (we recommend you use the bin subdirectory of your application).
  5. For IIS, you may need to add the directory you selected in the prior step to your system PATH environment variable using the Windows Control Panel.

Debugging ASP.NET Problems

Cannot find arulesnet.dll or one of its dependencies

If you get the error that ASP.NET cannot find arulesnet or one of its dependencies, it is likely because arulesnet.dll is not included as a reference in the project and copied to the bin subdirectory OR arules.dll (located in the Microsoft Office Library directory) is not on the system PATH environment variable. You must stop/restart IIS after modifying your PATH environment variable.

Stop/Restart IIS

Also you might have to stop/restart IIS and/or use Task Manager to stop the aspnet_wp process.

Turn on ASP.NET's Trace Facility

In the Web.config file under trace set enabled="true" and pageOutput="true"and if needed localOnly="false", e.g.

<trace enabled="true" requestLimit="10" pageOutput="true" traceMode="SortByTime" localOnly="false" />

This will overlay debugging information onto the each web page. You can also set pageOutput="false" and then open trace.axd in your application directory, e.g. http://localhost/ARulesXLWeb/trace.axd.

Run Under Visual Studio in Debug Mode

To Debug under Visual Studio, in the Web.config file under compilation, set Debug="true" as follows:

<compilation defaultLanguage="vb" debug="true" />

and build the Debug version of the project.

To display ARulesXL's ASP.NET Debug Log with the query answer set the ARULESXL_DEBUG constant in AdviceForm.aspx.vb or AdviceForm.aspx.cs to True.

Open an Amzi! Logic Server Trace File for Amzi! Tech Support

If none of the above items do not make the problem clear, the next step is to specify a log file in the arules.cfg file. To do this, add the following lines to your arules.cfg file in the /bin subdirectory:

apitrace = on 
logfile = c:\arulesapi.log

API Additions & Changes

Using the Amzi! Logic Server

The method GetLS() returns a LogicServer object that you can use with any of the Logic Server methods as documented in the Amzi! Logic Server Reference Guide.

Advice Samples

These samples are built using Visual Studio .NET 2005 and version 2.0 of the .NET Framework.

VB and C# .NET Application

The advice VB and C# samples are simple .NET Windows applications.

Building the Sample

In order to run this sample:

  1. Open the 'Product Advice.xls' spreadsheet sample and select ARulesXL | Export from the main menu to export a file named 'advice.axl'.
  2. Copy advice.axl, arulesrt.dll, ar_osutilsrt.lsx, ar_mysqlrt.lsx, arulesrt.xpl and arulesrt.cfg to the bin\Debug (or Release) subdirectory.
  3. In Visual Studio, open advice.sln.
  4. Select Project | Add Reference. Click on Browse and select arulesnet.dll in the api\bin_redist subdirectory. Click OK.
  5. Select Build | Rebuild Solution.

Running the Sample

  1. Select Debug | Start to run the sample.

IIS Web Application

The advice_web VB and C# .NET sample is web-based and runs under the IIS Web Server.

Building the Sample

In order to run this sample you must have both IIS and Visual Studio .NET installed. Follow these steps to create the ASP.NET application:

  1. In Visual Studio, select File | New | Web Site.
  2. Select 'ASP.NET Web Site', select the language and change the location to http://localhost/advice.
  3. Select Project | Add Reference. Click on Browse and select arulesnet.dll in the api\bin_redist subdirectory. Click OK.
  4. Select File | Save All, then close Visual Studio.
  5. Copy the files from the api\vb.net\samples\advice_web or api\cs.net\samples\advice_web directory to your InetPub\wwwroot\advice subdirectory.
  6. Open the 'Product Advice.xls' spreadsheet sample and select ARulesXL | Export from the main menu to export a file named 'advice.axl'.
  7. Copy advice.axl, arulesrt.dll, ar_osutilsrt.lsx, ar_mysqlrt.lsx, arulesrt.xpl and arulesrt.cfg to the InetPub\wwwroot\advice\bin subdirectory.
  8. Re-open Visual Studio and your advice project.
  9. Select Build | Rebuild Solution.

Running the Sample

  1. Select Debug | Start to run the sample under IIS.

 


Copyright ©2005-7 Amzi! inc. All Rights Reserved.
ARulesXL and Amzi! are trademarks or registered trademarks of Amzi!
Microsoft and Excel are trademarks or registered trademarks of Microsoft Corporation.