Runtime Error when trying to hook custom code

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
Post Reply
BlackIce
Ensign (ENS)
Ensign (ENS)
Posts: 12
Joined: Mon Aug 31, 2015 1:16 am

Runtime Error when trying to hook custom code

Post by BlackIce » Wed Oct 24, 2018 3:13 am

I'm trying to hook and execute custom code into the shop events, such as OrderPlaced event. I have copied my BiEventHandler.cs into ~/App_Code folder, and added the component to ~/App_Data/windsor.config, restarted the website and the application, but when i'm trying to access the website, i get a Runtime Error, and nothing is logged into the Log files.

The windsor.config:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <components>
	<component id="MyBiEventHandler" service="CommerceBuilder.Eventing.IStoreEventsHandler, CommerceBuilder"
 type="AbleCommerce.Code.BiEventHandler, AbleCommerce"/>
  </components>
</configuration>
The source of the BiEventHandler.cs is:

Code: Select all

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CommerceBuilder.DigitalDelivery;
using CommerceBuilder.DomainModel;
using CommerceBuilder.Eventing;
using CommerceBuilder.Messaging;
using CommerceBuilder.Orders;
using CommerceBuilder.Utility;

namespace AbleCommerce
{
    class BiEventHandler : DefaultEventsHandler
    {
        public override void OrderPlaced(object o, OrderPlacedEventArgs e)
        {
            Logger.Info("OrderPlaced event");
            base.OrderPlaced(o, e);
        }
    }
}
What am i missing something? Thank you in advance!

BlackIce
Ensign (ENS)
Ensign (ENS)
Posts: 12
Joined: Mon Aug 31, 2015 1:16 am

Re: Runtime Error when trying to hook custom code

Post by BlackIce » Thu Oct 25, 2018 1:52 am

I was able to resolve the issue based on this article:
http://wiki.ablecommerce.com/index.php/ ... or_AC_Gold

Although, i had to copy my DLL to "~/Bin/", while the article says it should be copied to "~/App_Data/Bin/".

Post Reply