Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Peter 4 posts 25 karma points
    Nov 23, 2012 @ 15:24
    Peter
    0

    uCommerce API Outside the Web Context - Error on setup the project

    I've tried to expose uCommerce API outside the web context. I've created a new solution and follow the recommendations from Enable the uCommerce E-commerce API Outside the Web Context, but using latest binaries and configuration files. All went good until I found this error and I couldn't continue:

    An exception of type 'Castle.MicroKernel.ComponentActivator.ComponentActivatorException' occurred in Castle.Windsor.DLL but was not handled in user code

    Additional
    information: could not instantiate UCommerce.EntitiesV2.Repository`1[[UCommerce.EntitiesV2.Product, UCommerce, Version=3.0.0.12278, Culture=neutral, PublicKeyToken=null]] Source=Castle.Windsor

    This exception occurs in the first line of the sample:

    var productList = Product.All().FirstOrDefault();

    The application is a console application and it has defined all standard uCommerce settings. I have followed the other discussions and made sure the DLLs are all updates, referenced and copied to the Bin folder.

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
    <configSections>
    <sectionGroup name="commerce" type="System.Configuration.ConfigurationSectionGroup">
    <section name="catalogConfiguration" type="UCommerce.Infrastructure.Configuration.CatalogConfigurationSection" />
    <section name="runtimeConfiguration" type="UCommerce.Infrastructure.Configuration.RuntimeConfigurationSection" />
    <section name="securityConfiguration" type="UCommerce.Infrastructure.Configuration.SecurityConfigurationSection" />
    <section name="amazonPaymentMethodService" type="UCommerce.Transactions.Payments.Amazon.Configuration.AmazonPaymentMethodServiceConfigurationSection, UCommerce.Transactions.Payments" requirePermission="false" />
    <section name="authorizedotnetPaymentMethodService" type="UCommerce.Transactions.Payments.Configuration.AuthorizedotnetPaymentMethodServiceConfigurationSection, UCommerce.Transactions.Payments" requirePermission="false" />
    <section name="braintreePaymentMethodService" type="UCommerce.Transactions.Payments.Configuration.BraintreePaymentMethodServiceConfigurationSection, UCommerce.Transactions.Payments" requirePermission="false" />
    <section name="dibsPaymentMethodService" type="UCommerce.Transactions.Payments.Configuration.DibsPaymentMethodServiceConfigurationSection, UCommerce.Transactions.Payments" requirePermission="false" />
    <section name="ePayPaymentMethodService" type="UCommerce.Transactions.Payments.Configuration.EPayPaymentMethodServiceConfigurationSection, UCommerce.Transactions.Payments" requirePermission="false" />
    <section name="eWayPaymentMethodService" type="UCommerce.Transactions.Payments.Configuration.EWayPaymentMethodServiceConfigurationSection, UCommerce.Transactions.Payments" requirePermission="false" />
    <section name="googleCheckoutPaymentMethodService" type="UCommerce.Transactions.Payments.Configuration.GoogleCheckoutPaymentMethodServiceConfigurationSection, UCommerce.Transactions.Payments" requirePermission="false" />
    <section name="idealIngPaymentMethodService" type="UCommerce.Transactions.Payments.Configuration.IdealIngPaymentMethodServiceConfigurationSection, UCommerce.Transactions.Payments" requirePermission="false" />
    <section name="multiSafepayPaymentMethodService" type="UCommerce.Transactions.Payments.Configuration.MultiSafepayPaymentMethodServiceConfigurationSection, UCommerce.Transactions.Payments" requirePermission="false" />
    <section name="ogonePaymentMethodService" type="UCommerce.Transactions.Payments.Configuration.OgonePaymentMethodServiceConfigurationSection, UCommerce.Transactions.Payments" requirePermission="false" />
    <section name="payerPaymentMethodService" type="UCommerce.Transactions.Payments.Configuration.PayerPaymentMethodServiceConfigurationSection, UCommerce.Transactions.Payments" requirePermission="false" />
    <section name="payExPaymentMethodService" type="UCommerce.Transactions.Payments.Configuration.PayExPaymentMethodServiceConfigurationSection, UCommerce.Transactions.Payments" requirePermission="false" />
    <section name="payPalPaymentMethodService" type="UCommerce.Transactions.Payments.Configuration.PayPalPaymentMethodServiceConfigurationSection, UCommerce.Transactions.Payments" requirePermission="false" />
    <section name="sagePayPaymentMethodService" type="UCommerce.Transactions.Payments.Configuration.SagePayPaymentMethodServiceConfigurationSection, UCommerce.Transactions.Payments" requirePermission="false" />
    <section name="worldPayPaymentMethodService" type="UCommerce.Transactions.Payments.Configuration.WorldPayPaymentMethodServiceConfigurationSection, UCommerce.Transactions.Payments" requirePermission="false" />
    </sectionGroup>
    </configSections>
    <connectionStrings>
    <remove name="LocalSqlServer" />
    <!--<add name="ucommerce" connectionString="Data Source=Web4Petru\SQLEXPRESS;Initial Catalog=umbracoWeb4SoundDev;user id=umbracoDev;password=BadPassword2012!" providerName="System.Data.SqlClient"/>-->
    </connectionStrings>
    <appSettings>
    <add key="umbracoDbDSN" value="server=WEB4SOUND\SQLEXPRESS;database=umbracoWeb4SoundDev;user id=umbracoDev;password=BadPassword2012!" />
    </appSettings>
    <commerce>
    <runtimeConfiguration enableCache="true" cacheProvider="NHibernate.Caches.SysCache2.SysCacheProvider, NHibernate.Caches.SysCache2" connectionString="(auto)" />
    <catalogConfiguration defaultCultureCode="en-US" enforceCategoryNameUniquenessWithinCatalogs="true" />
    <securityConfiguration enable="true" />
    <amazonPaymentMethodService configSource="ucommerce\configuration\payments\Amazon.config" />
    <authorizedotnetPaymentMethodService configSource="ucommerce\configuration\payments\Authorizedotnet.config" />
    <braintreePaymentMethodService configSource="ucommerce\configuration\payments\Braintree.config" />
    <dibsPaymentMethodService configSource="ucommerce\configuration\payments\Dibs.config" />
    <ePayPaymentMethodService configSource="ucommerce\configuration\payments\ePay.config" />
    <eWayPaymentMethodService configSource="ucommerce\configuration\payments\eWay.config" />
    <googleCheckoutPaymentMethodService configSource="ucommerce\configuration\payments\GoogleCheckout.config" />
    <idealIngPaymentMethodService configSource="ucommerce\configuration\payments\Ideal-Ing.config" />
    <multiSafepayPaymentMethodService configSource="ucommerce\configuration\payments\MultiSafepay.config" />
    <ogonePaymentMethodService configSource="ucommerce\configuration\payments\Ogone.config" />
    <payerPaymentMethodService configSource="ucommerce\configuration\payments\Payer.config" />
    <payExPaymentMethodService configSource="ucommerce\configuration\payments\PayEx.config" />
    <payPalPaymentMethodService configSource="ucommerce\configuration\payments\PayPal.config" />
    <sagePayPaymentMethodService configSource="ucommerce\configuration\payments\SagePay.config" />
    <worldPayPaymentMethodService configSource="ucommerce\configuration\payments\WorldPay.config" />
    </commerce>
    </configuration>

    Could you please help ?

     

  • Peter 4 posts 25 karma points
    Nov 24, 2012 @ 10:37
    Peter
    1

    Issue was resolved and it was due to an missing configuration in the app.config

  • Søren Spelling Lund 1797 posts 2786 karma points
    Nov 27, 2012 @ 23:13
    Søren Spelling Lund
    0

    Thanks for being awesome and posting the follow-up here! #h5yr!

  • Fabio Milheiro 74 posts 136 karma points
    Jan 09, 2013 @ 19:43
    Fabio Milheiro
    0

    Hi Peter, can you please tell us which configuration was missing. I have been facing this almost all day!

    Thanks,

    Fabio

  • Peter 4 posts 25 karma points
    Jan 10, 2013 @ 15:10
    Peter
    0

    Hi Fabio,

    Actually I did more configurations, but one of them which was not obvious was to add a post build event to my library to copy all the output binaries in the hosting application. As a design, I have an Windows service application and entire logic to access uCommerce is hosted in a DLL. I've added below a sample:

                 XCOPY "$(ProjectDir)bin\debug\*.*" "$(SolutionDir)ServiceWeb\bin\Debug\*.*" /Y

    To be able to better help you, please be more specific and add error details.

    Thanks,

    Peter

     

     

  • Fabio Milheiro 74 posts 136 karma points
    Jan 10, 2013 @ 15:12
    Fabio Milheiro
    0

    Hi Peter,

    Thanks for taking the time to help.

    I described my problem here: http://our.umbraco.org/projects/website-utilities/ucommerce/ucommerce-support/37414-uCommerce-can't-instantiate-product-catalog

    If you can help, please let me know and thanks!

    Fabio

  • Vignesh 3 posts 23 karma points
    Mar 22, 2013 @ 08:17
    Vignesh
    0

    Hi Peter/Soren/Fabio,

    I follow your solution. But i still facing a same error. Can anyone give idea?

    Below my coding was posted. 

     

    App Config:

     

    <?xml version="1.0"?>

    <configuration>

    <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>

      <configSections>

        <sectionGroup name="commerce" type="System.Configuration.ConfigurationSectionGroup">

          <section name="catalogConfiguration" type="UCommerce.Infrastructure.Configuration.CatalogConfigurationSection" />

          <section name="runtimeConfiguration" type="UCommerce.Infrastructure.Configuration.RuntimeConfigurationSection" />

          <section name="securityConfiguration" type="UCommerce.Infrastructure.Configuration.SecurityConfigurationSection" />

          <section name="amazonPaymentMethodService" type="UCommerce.Transactions.Payments.Amazon.Configuration.AmazonPaymentMethodServiceConfigurationSection, UCommerce.Transactions.Payments" requirePermission="false" />

          <section name="authorizedotnetPaymentMethodService" type="UCommerce.Transactions.Payments.Configuration.AuthorizedotnetPaymentMethodServiceConfigurationSection, UCommerce.Transactions.Payments" requirePermission="false" />

          <section name="braintreePaymentMethodService" type="UCommerce.Transactions.Payments.Configuration.BraintreePaymentMethodServiceConfigurationSection, UCommerce.Transactions.Payments" requirePermission="false" />

          <section name="dibsPaymentMethodService" type="UCommerce.Transactions.Payments.Configuration.DibsPaymentMethodServiceConfigurationSection, UCommerce.Transactions.Payments" requirePermission="false" />

          <section name="ePayPaymentMethodService" type="UCommerce.Transactions.Payments.Configuration.EPayPaymentMethodServiceConfigurationSection, UCommerce.Transactions.Payments" requirePermission="false" />

          <section name="eWayPaymentMethodService" type="UCommerce.Transactions.Payments.Configuration.EWayPaymentMethodServiceConfigurationSection, UCommerce.Transactions.Payments" requirePermission="false" />

          <section name="googleCheckoutPaymentMethodService" type="UCommerce.Transactions.Payments.Configuration.GoogleCheckoutPaymentMethodServiceConfigurationSection, UCommerce.Transactions.Payments" requirePermission="false" />

          <section name="idealIngPaymentMethodService" type="UCommerce.Transactions.Payments.Configuration.IdealIngPaymentMethodServiceConfigurationSection, UCommerce.Transactions.Payments" requirePermission="false" />

          <section name="multiSafepayPaymentMethodService" type="UCommerce.Transactions.Payments.Configuration.MultiSafepayPaymentMethodServiceConfigurationSection, UCommerce.Transactions.Payments" requirePermission="false" />

          <section name="ogonePaymentMethodService" type="UCommerce.Transactions.Payments.Configuration.OgonePaymentMethodServiceConfigurationSection, UCommerce.Transactions.Payments" requirePermission="false" />

          <section name="payerPaymentMethodService" type="UCommerce.Transactions.Payments.Configuration.PayerPaymentMethodServiceConfigurationSection, UCommerce.Transactions.Payments" requirePermission="false" />

          <section name="payExPaymentMethodService" type="UCommerce.Transactions.Payments.Configuration.PayExPaymentMethodServiceConfigurationSection, UCommerce.Transactions.Payments" requirePermission="false" />

          <section name="payPalPaymentMethodService" type="UCommerce.Transactions.Payments.Configuration.PayPalPaymentMethodServiceConfigurationSection, UCommerce.Transactions.Payments" requirePermission="false" />

          <section name="sagePayPaymentMethodService" type="UCommerce.Transactions.Payments.Configuration.SagePayPaymentMethodServiceConfigurationSection, UCommerce.Transactions.Payments" requirePermission="false" />

          <section name="worldPayPaymentMethodService" type="UCommerce.Transactions.Payments.Configuration.WorldPayPaymentMethodServiceConfigurationSection, UCommerce.Transactions.Payments" requirePermission="false" />

        </sectionGroup>

      </configSections>

      <connectionStrings>

        <add name="ucommerce" connectionString="server=192.168.1.9;database=MyLocalDB;user id=sa;password=kbs" providerName="System.Data.SqlClient" />

      </connectionStrings>

      <commerce>

        <runtimeConfiguration enableCache="true" cacheProvider="NHibernate.Caches.SysCache2.SysCacheProvider, NHibernate.Caches.SysCache2" connectionString="(auto)" />

        <catalogConfiguration defaultCultureCode="en-US" enforceCategoryNameUniquenessWithinCatalogs="true" />

        <securityConfiguration enable="true" />

        <amazonPaymentMethodService configSource="configuration\payments\Amazon.config" />

        <authorizedotnetPaymentMethodService configSource="configuration\payments\Authorizedotnet.config" />

        <braintreePaymentMethodService configSource="configuration\payments\Braintree.config" />

        <dibsPaymentMethodService configSource="configuration\payments\Dibs.config" />

        <ePayPaymentMethodService configSource="configuration\payments\ePay.config" />

        <eWayPaymentMethodService configSource="configuration\payments\eWay.config" />

        <googleCheckoutPaymentMethodService configSource="configuration\payments\GoogleCheckout.config" />

        <idealIngPaymentMethodService configSource="configuration\payments\Ideal-Ing.config" />

        <multiSafepayPaymentMethodService configSource="configuration\payments\MultiSafepay.config" />

        <ogonePaymentMethodService configSource="configuration\payments\Ogone.config" />

        <payerPaymentMethodService configSource="configuration\payments\Payer.config" />

        <payExPaymentMethodService configSource="configuration\payments\PayEx.config" />

        <payPalPaymentMethodService configSource="configuration\payments\PayPal.config" />

        <sagePayPaymentMethodService configSource="configuration\payments\SagePay.config" />

        <worldPayPaymentMethodService configSource="configuration\payments\WorldPay.config" />

      </commerce>

    </configuration>

    This is my bin folder:

     

    My post event

     

     XCOPY "$(ProjectDir)bin\debug\*.*" "$(SolutionDir)Project.Web\bin\*.*" /Y

    My Bug was:

    ComponentActivator: could not instantiate UCommerce.EntitiesV2.Repository`1[[UCommerce.EntitiesV2.Product, UCommerce, Version=3.0.0.12320, Culture=neutral, PublicKeyToken=null]]

     

    Please give some idea.

     

    Thanks

    Vignesh D

  • Søren Spelling Lund 1797 posts 2786 karma points
    Apr 10, 2013 @ 16:38
    Søren Spelling Lund
    0

    I posted a new version of the article with specific instrucutions for uCommerce 3: Using the uCommerce 3 API in a Windows Application.

    Hope this helps.

Please Sign in or register to post replies

Write your reply to:

Draft