nop 2.0 Plugin

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 years ago
7Spikes wrote:
How can we delete posts in the forum? We don't see a delete button :)

Deleting forums posts is disabled
12 years ago
I have had this issue and the Restart Application button in admin did not seem to solve it for me. Eventually I went to the global.asax and added a space as stated earlier which did resolve it.
12 years ago
gkennedy1 wrote:
I have had this issue and the Restart Application button in admin did not seem to solve it for me.

This issue is resolved in upcoming version 2.30 (not in 2.20)
12 years ago
a.m. wrote:
I have had this issue and the Restart Application button in admin did not seem to solve it for me.
This issue is resolved in upcoming version 2.30 (not in 2.20)


I've developed SMS plugin....

and i got same error
"The controller for path '/Admin/SMS/ConfigureProvider' was not found or does not implement IController."

and i've tried all solution as mentioned in above post...
but did not work for me....


what could be the reason....????
and my routeprovider.cs is below.


using System.Web.Mvc;
using System.Web.Routing;
using Nop.Web.Framework.Mvc.Routes;


namespace Nop.Plugin.SMS.CountrySMS
{
    public partial class RouteProvider : IRouteProvider
    {
        public void RegisterRoutes(RouteCollection routes)
        {
         var route =routes.MapRoute("Plugin.SMS.CountrySMS.Configure",
                  "Plugins/SMSCountry/Configure",
                  new { controller = "SMSCountry", action = "Configure" },
                  new[] { "Nop.Plugin.SMS.CountrySMS.Controllers" }
            );
         route.DataTokens.Add("Area", "Admin");
            
        }
        public int Priority
        {
            get
            {
                return 0;
            }
        }
    }
}




Controller:
using System;
using System.Web.Mvc;
using Nop.Core;
using Nop.Plugin.SMS.CountrySMS;
using Nop.Plugin.SMS.CountrySMS.Models;

using Nop.Services.Configuration;
using Nop.Services.Localization;
using Nop.Services.Messages;
using Nop.Web.Framework.Controllers;


namespace Nop.Plugin.SMS.CountrySMS.Controllers
{
       [AdminAuthorize]
     public  class SMSCountryControllers:Controller
    {

        private readonly CountrySMSSettings _CountrySMSSettings;
        private readonly ISettingService _settingService;
        private readonly ISmsService _smsService;
        private readonly ILocalizationService _localizationService;

        public SMSCountryControllers(CountrySMSSettings countrySMSSettings, ISettingService settingService, ISmsService smsService,
            ILocalizationService localizationService)
        {
            this._CountrySMSSettings = countrySMSSettings;
            this._settingService = settingService;
            this._smsService = smsService;
            this._localizationService = localizationService;
        }


      
           public ActionResult Configure()
           {
               var model = new CountrySMSModel();
               model.Username = _CountrySMSSettings.Username;
               model.Password = _CountrySMSSettings.Password;
               return View("Nop.Plugin.SMS.CountrySMS.Views.SMSCountry.Configure", model);
           }

           [HttpPost, ActionName("Configure")]
           [FormValueRequired("save")]
           public ActionResult ConfigurePOST(CountrySMSModel model)
           {
               if (!ModelState.IsValid)
               {
                   return Configure();
               }

               //save settings
              _CountrySMSSettings.Username = model.Username;
              _CountrySMSSettings.Password = model.Password;
               _settingService.SaveSetting(_CountrySMSSettings);

               return View("Nop.Plugin.SMS.CountrySMS.Views.SMSCountry.Configure", model);
           }
    }
}


Model:

using Nop.Web.Framework;

namespace Nop.Plugin.SMS.CountrySMS.Models
{
   public class CountrySMSModel
    {
       [NopResourceDisplayName("Plugins.Sms.CountrySMS.Fields.Username")]
        public string Username { get; set; }

        [NopResourceDisplayName("Plugins.Sms.CountrySMS.Fields.Password")]
        public string Password { get; set; }


        
    }
}


CountrySmsProvider.cs:

using System;
using System.Linq;
using System.Web.Routing;
using Nop.Core.Domain;
using Nop.Core.Domain.Messages;
using Nop.Core.Plugins;
using Nop.Services.Configuration;
using Nop.Services.Logging;
using Nop.Services.Messages;

namespace Nop.Plugin.SMS.CountrySMS
{
    public class CountrySmsProvider : BasePlugin, ISmsProvider
    {
        private readonly CountrySMSSettings _CountrySMSSettings;
        private readonly IQueuedEmailService _queuedEmailService;
        private readonly IEmailAccountService _emailAccountService;
        private readonly ILogger _logger;
        private readonly ISettingService _settingService;
        private readonly StoreInformationSettings _storeSettings;
        private readonly EmailAccountSettings _emailAccountSettings;

        public CountrySmsProvider(CountrySMSSettings countrySMSSettings,
               IQueuedEmailService queuedEmailService, IEmailAccountService emailAccountService,
               ILogger logger, ISettingService settingService, StoreInformationSettings storeSettigs,
               EmailAccountSettings emailAccountSettings)
        {
            this._CountrySMSSettings = countrySMSSettings;
            this._queuedEmailService = queuedEmailService;
            this._emailAccountService = emailAccountService;
            this._logger = logger;
            this._settingService = settingService;

            this._storeSettings = storeSettigs;
            this._emailAccountSettings = emailAccountSettings;
        }


      

        /// <summary>
        /// Sends SMS
        /// </summary>
        /// <param name="text">SMS text</param>
        /// <returns>Result</returns>
        public bool SendSms(string text)
        {
            try
            {
                 SMSCAPI obj = new SMSCAPI();
                 string strPostResponse;
                     strPostResponse = obj.SendSMS(_CountrySMSSettings.Username, _CountrySMSSettings.Password, "919XXXXXXXXX", "hi");
                    
                    return true;
                  
              
            }
            catch (Exception ex)
            {
                _logger.Error(ex.Message, ex);
            }
            return false;
            }
         /// <summary>
        /// Gets a route for provider configuration
        /// </summary>
        /// <param name="actionName">Action name</param>
        /// <param name="controllerName">Controller name</param>
        /// <param name="routeValues">Route values</param>
        public void GetConfigurationRoute(out string actionName, out string controllerName, out RouteValueDictionary routeValues)
        {
            actionName = "Configure";
            controllerName = "SMSCountry";
            routeValues = new RouteValueDictionary() { { "Namespaces", "Nop.Plugin.SMS.CountrySMS.Controllers" }, { "area", null } };
        }
        /// <summary>
        /// Install plugin
        /// </summary>
        public override void Install()
        {
            var settings = new CountrySMSSettings();
            {
              
            };
            _settingService.SaveSetting(settings);

            base.Install();
        }
        }
    
}


CountrySMSSettings.cs:

using Nop.Core.Configuration;
namespace Nop.Plugin.SMS.CountrySMS
{
    public class CountrySMSSettings:ISettings
    {
        public string Username { get; set; }
        public string Password { get; set; }
    }
}





and my stack trace is:

Stack Trace:

[HttpException (0x80004005): The controller for path '/Admin/SMS/ConfigureProvider' was not found or does not implement IController.]
   System.Web.Mvc.DefaultControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType) +329974
   System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName) +74
   System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory) +232
   System.Web.Mvc.<>c__DisplayClass6.<BeginProcessRequest>b__2() +49
   System.Web.Mvc.<>c__DisplayClassb`1.<ProcessInApplicationTrust>b__a() +13
   System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f) +7
   System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +22
   System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Func`1 func) +124
   System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) +98
   System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContext httpContext, AsyncCallback callback, Object state) +50
   System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) +16
   System.Web.Mvc.<>c__DisplayClass7.<BeginProcessRequest>b__6() +29
   System.Web.Mvc.ServerExecuteHttpHandlerWrapper.Wrap(Func`1 func) +38

[HttpException (0x80004005): Execution of the child request failed. Please examine the InnerException for more information.]
   System.Web.Mvc.ServerExecuteHttpHandlerWrapper.Wrap(Func`1 func) +110
   System.Web.Mvc.ServerExecuteHttpHandlerAsyncWrapper.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) +98
   System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride) +1529
   System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage) +77
   System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm) +28
   System.Web.HttpServerUtilityWrapper.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm) +22
   System.Web.Mvc.Html.ChildActionExtensions.ActionHelper(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues, TextWriter textWriter) +497
   System.Web.Mvc.Html.ChildActionExtensions.Action(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues) +88
   ASP._Page_Administration_Views_SMS_ConfigureProvider_cshtml.Execute() in c:\Users\Developer\Documents\NopCommerce_2_20\Presentation\Nop.Web\Administration\Views\Sms\ConfigureProvider.cshtml:16
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +273
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +81
   System.Web.WebPages.StartPage.RunPage() +58
   System.Web.WebPages.StartPage.ExecutePageHierarchy() +93
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +173
   System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +220
   System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) +115
   System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +303
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) +13
   System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +23
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +260
   System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +177
   System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +343
   System.Web.Mvc.Controller.ExecuteCore() +116
   System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +97
   System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +10
   System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +37
   System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +21
   System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +12
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
   System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +50
   System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f) +7
   System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +22
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +60
   System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8963149
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184




Please help me....

am i missing something ...???



Thank You.....
12 years ago
a.m. wrote:
have a look at the following plugin creation tutorial - http://csharpwebdeveloper.com/writing-nopcommerce-2-plugin


The link provided not working. Can I find the tutorial somewhere else?
12 years ago
I think the link changed to:

http://blog.csharpwebdeveloper.com/2011/09/10/writing-a-plugin-for-nopcommerce-2-x/
12 years ago
I too am having trouble with the error mentioned above.  (See below).  I have added a new Widget/Plugin for nopCommerce 2.20 but when I go to the administration section and click the "Add Widget" link, I get the error below.

I have cleared all my temporary files (including the Temporary ASP.NET files folder as metnioned above) but I am still receiving this error.  I can see that the
GetConfigurationRoute()
method is being called but it throws the error right after that.

Please help!  I'm working on a deadline for Monday.

Server Error in '/' Application.
--------------------------------------------------------------------------------

The controller for path '/Admin/Widget/Create' was not found or does not implement IController.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: The controller for path '/Admin/Widget/Create' was not found or does not implement IController.

Source Error:


Line 50:     if (!String.IsNullOrEmpty(Model.ConfigurationActionName))
Line 51:     {
Line 52:     @Html.Action(Model.ConfigurationActionName, Model.ConfigurationControllerName, Model.ConfigurationRouteValues);
Line 53:     }
Line 54:     if (ViewBag.RedirectedToList == true)


Source File: c:\Projects\NopCommerce\nopCommerce_2.20_Source_snoozer.com\Presentation\Nop.Web\Administration\Views\Widget\Create.cshtml    Line: 52

Stack Trace:


[HttpException (0x80004005): The controller for path '/Admin/Widget/Create' was not found or does not implement IController.]
   System.Web.Mvc.DefaultControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType) +329974
   System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName) +74
   System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory) +232
   System.Web.Mvc.<>c__DisplayClass6.<BeginProcessRequest>b__2() +49
   System.Web.Mvc.<>c__DisplayClassb`1.<ProcessInApplicationTrust>b__a() +13
   System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f) +7
   System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +22
   System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Func`1 func) +124
   System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) +98
   System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContext httpContext, AsyncCallback callback, Object state) +50
   System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) +16
   System.Web.Mvc.<>c__DisplayClass7.<BeginProcessRequest>b__6() +29
   System.Web.Mvc.ServerExecuteHttpHandlerWrapper.Wrap(Func`1 func) +38

[HttpException (0x80004005): Execution of the child request failed. Please examine the InnerException for more information.]
   System.Web.Mvc.ServerExecuteHttpHandlerWrapper.Wrap(Func`1 func) +110
   System.Web.Mvc.ServerExecuteHttpHandlerAsyncWrapper.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) +98
   System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride) +1529
   System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage) +77
   System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm) +28
   System.Web.HttpServerUtilityWrapper.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm) +22
   System.Web.Mvc.Html.ChildActionExtensions.ActionHelper(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues, TextWriter textWriter) +497
   System.Web.Mvc.Html.ChildActionExtensions.Action(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues) +88
   ASP._Page_Administration_Views_Widget_Create_cshtml.Execute() in c:\Projects\NopCommerce\nopCommerce_2.20_Source_snoozer.com\Presentation\Nop.Web\Administration\Views\Widget\Create.cshtml:52
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +273
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +81
   System.Web.WebPages.StartPage.RunPage() +58
   System.Web.WebPages.StartPage.ExecutePageHierarchy() +93
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +173
   System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +220
   System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) +115
   System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +303
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) +13
   System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +23
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +260
   System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +177
   System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +343
   System.Web.Mvc.Controller.ExecuteCore() +116
   System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +97
   System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +10
   System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +37
   System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +21
   System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +12
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
   System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +50
   System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f) +7
   System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +22
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +60
   System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8963149
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184

12 years ago
This error prevents customers from installing plugins after the main nop installation...so, for regular users its impossible to use plugins in shared hosts.

There`s no temporary solution?
12 years ago
SergioLuiz wrote:
This error prevents customers from installing plugins after the main nop installation...so, for regular users its impossible to use plugins in shared hosts.

There`s no temporary solution?


Please verify your controller spelling......

It should not be abccontrollers ....It should be simple abccontroller....

I made this mistake.....and faced this error....

and i just changed this spelling and it is working perfectly....
12 years ago
My plugin is ok, it works.

When you install it in a previous installed nopCommerce, the Configure option only works if you wipe the ASP.net Temporary folder.

The ASP.net cache is the problem here, and restart iis or change the web.config doesnt help...

But users with Shared hosting cannot do that...they have to create another virtual dir and install nop again, with the plugin inside.

So, theres no problem with routes or names...the plugin system needs to be changed or something like that.

They say that it will be fixed in version 2.3.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.