Inject NopObjectContext to constructor of service classes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 年 前
I have pretty much copied all the relevant sections from Web.config into my service config. I also copied ConnectionStrings.config to the root of my service from the NOP site. Still getting the same error.

<configuration>
  <configSections>
    <section name="NopConfig" type="NopSolutions.NopCommerce.BusinessLogic.Configuration.NopConfig, Nop.BusinessLogic" requirePermission="false"/>
  </configSections>
  
  <appSettings>
    <add key="ChartImageHandler" value="storage=file;" />
    <add key="UseSSL" value="false" />
    <add key="SharedSSLUrl" value="" />
    <add key="NonSharedSSLUrl" value="" />
    <add key="GoogleMerchantID" value="" />
    <add key="GoogleMerchantKey" value="" />
    <add key="GoogleEnvironment" value="Sandbox" />
    <add key="GoogleAuthenticateCallback" value="True" />
    <add key="FCKeditor:BasePath" value="~/editors/fckeditor/" />
    <add key="FCKeditor:UserFilesPath" value="~/images/" />
    <add key="dependencyResolverTypeName" value="NopSolutions.NopCommerce.BusinessLogic.Infrastructure.UnityDependencyResolver, Nop.BusinessLogic" />
  </appSettings>

  <NopConfig>
    <SqlServer ConnectionStringName="NopSqlConnection"/>
    <ScheduleTasks>
      <Thread seconds="60">
        <!--do NOT enable ClearCache task if you have enabled tracking online users-->
        <task name="ClearCache" type="NopSolutions.NopCommerce.BusinessLogic.Caching.ClearCacheTask, Nop.BusinessLogic" enabled="false" stopOnError="false"/>
        <task name="PurgeOnlineUsers" type="NopSolutions.NopCommerce.BusinessLogic.Audit.UsersOnline.PurgeOnlineUsersTask, Nop.BusinessLogic" enabled="true" stopOnError="false"/>
        <task name="Emails" type="NopSolutions.NopCommerce.BusinessLogic.Messages.SendQueuedMessagesTask, Nop.BusinessLogic" enabled="true" stopOnError="false" maxTries="5"/>
        <task name="KeepAlive" type="NopSolutions.NopCommerce.BusinessLogic.Utils.KeepAliveTask, Nop.BusinessLogic" enabled="true" stopOnError="false" path="keepalive/ping.ashx"/>
      </Thread>
      <Thread seconds="600">
        <task name="DeleteExpiredCustomerSessions" type="NopSolutions.NopCommerce.BusinessLogic.CustomerManagement.DeleteExpiredCustomerSessionsTask, Nop.BusinessLogic" enabled="true" stopOnError="false" deleteExpiredCustomerSessionsOlderThanMinutes="43200"/>
        <task name="DeleteExpiredShoppingCarts" type="NopSolutions.NopCommerce.BusinessLogic.Orders.DeleteExpiredShoppingCartsTask, Nop.BusinessLogic" enabled="false" stopOnError="false" deleteExpiredShoppingCartsOlderThanMinutes="259200"/>
      </Thread>
      <Thread seconds="60">
        <task name="UpdateExchangeRates" type="NopSolutions.NopCommerce.BusinessLogic.Directory.ExchangeRates.UpdateExchangeRateTask, Nop.BusinessLogic" enabled="true" stopOnError="false"/>
      </Thread>
      <Thread seconds="3600">
        <task name="DatabaseMaintance" type="NopSolutions.NopCommerce.BusinessLogic.Maintenance.DatabaseMaintanceTask, Nop.BusinessLogic" enabled="false" stopOnError="false"/>
      </Thread>
    </ScheduleTasks>
  </NopConfig>
</configuration>
13 年 前
Found the issue, my config didn't have the connection string node :)
13 年 前
i told u b4....ur solution shd have the connection string node....
13 年 前
I did but I followed suite with the NOPCommerce store with a separate ConnectionStrings.config file. It wasn't until I took the   <configSections> node and inserted into web.config that it worked. Just thought I would clarify that in case someone else ran into the same problem.

Thanks again for the help.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.