nop 2.0 Plugin

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Hace 12 años
I've tried with Firefox. I get the following message:

We're sorry, an internal error occurred that prevents the request to complete.

Our supporting staff has been notified with this error and will address this issue shortly. We profusely apologize for the inconvenience and for any damage this may cause. You might want to try the same action at later time.

Thanks
Hace 12 años
Have you looked into the Nop systemlog?

TCH
Hace 12 años
OK. Thanks. In Nop Systemlog I have this message:

System.Web.HttpException (0x80004005): Execution of the child request failed. Please examine the InnerException for more information. ---> System.Web.HttpException (0x80004005): The controller for path '/Admin/Payment/ConfigureMethod' was not found or does not implement IController. at System.Web.Mvc.DefaultControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType) at System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName) at System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory) at System.Web.Mvc.MvcHandler.<>c__DisplayClass6.<BeginProcessRequest>b__2() at System.Web.Mvc.SecurityUtil.<>c__DisplayClassb`1.<ProcessInApplicationTrust>b__a() at System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust[TResult](Func`1 func) at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.Wrap[TResult](Func`1 func) at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.Wrap[TResult](Func`1 func) at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride) at System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage) at System.Web.HttpServerUtilityWrapper.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm) at System.Web.Mvc.Html.ChildActionExtensions.ActionHelper(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues, TextWriter textWriter) at System.Web.Mvc.Html.ChildActionExtensions.Action(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues) at ASP._Page_Administration_Views_Payment_ConfigureMethod_cshtml.Execute() in c:\inetpub\ILicor\Administration\Views\Payment\ConfigureMethod.cshtml:line 16 at System.Web.WebPages.WebPageBase.ExecutePageHierarchy() at System.Web.Mvc.WebViewPage.ExecutePageHierarchy() at System.Web.WebPages.StartPage.ExecutePageHierarchy() at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName)
Hace 12 años
I got the same error message until I replaced these files in the bin folder with the new onces created when building the plugin:

Nop.Core
Nop.Data
Nop.Servcies
Nop.Services.XmlSerializers
Nop.Web.Framework

Why this is necessary I don´t know.

Backup your original bin files before uploading the new onces, just in case anything goes wrong.
Hace 12 años
Thanks. I will try.
Hace 12 años
Hi,

I had the same problem. I had forgotten to updated the hardcoded controllername in
GetConfigurationRoute and GetPaymentInfoRoute in my Processor file.

Hope that helps.

Regards,
Bernt Rune
Hace 12 años
I was receiving the dreaded "The controller for path '/nop/Admin/Payment/ConfigureMethod' was not found or does not implement IController." error. I followed TCH's suggestion and copied over any new nop core file,

e.g.

Nop.Core
Nop.Data
Nop.Servcies
Nop.Services.XmlSerializers
Nop.Web.Framework

... and voila! this worked for me. Not really sure why it worked though :/

I'd like to blog about how to create a payment method but this is going to be a sticking point. Also, I can't seem to get my plugin to get deployed with the Deploy.bat file, I have to move my plugin files over manually.

HTH,

-sharpguru
Hace 12 años
I also received this error today for the first time (when modifying one of the existing payment plugins). It disappeared right after I've cleaned the solution (Right-click on your solution, click 'Clean solution').

But it's still not clear why and when this error appears.
Hace 12 años
Hi guys,

We would like to share some of the problems/solutions we experience during developing our plugins as obviously you experience the same problems.

All nopCommerce plugins have their views as embedded resources.
So the problem is in the way plugin assemblies are being loaded into memory.
Plugin assemblies are loaded at application start-up by the PluginManager class.

[assembly: PreApplicationStartMethod(typeof(PluginManager), "Initialize")]

So after you make a change to your plugins make sure you have restarted your application, so that the Initialize method to be executed and the changes to take an effect.

But that’s not all. NEVER copy any assembly in you plugin folder which is already present in the Nop.Web bin folder. As there might be many side effects from that because of the Temporary ASP.NET folders that contain shadow copied assemblies.
For this reason there might be cases when the same assembly is loaded twice(this was the case in Nop 2.0) in the the same AppDomain as the only difference is the location it has been loaded from  i.e if your plugin contains Nop.Web.Framework.dll then Nop.Web.Framework will be loaded from there and then will be shadow copied in the Temp Asp.NET folder but also it will be loaded again because it is in the bin folder of the application. This caused us a huge problem when we started developing nopCommerce plugins. All our plugins that referenced Nop.Web.Framework.dll used to copy local the referenced dll in their Plugins folders. So the Nop.Web.Framework assebly was loaded twice in the AppDomain. Then later when the AppFinder was asked for all types that implement IDependencyRegister it didn’t return the main DependencyRegister and we ended up with none of the main services being registered.
Then we realized the problem and made all references to have Copy Local set to False.
Now everything is working fine and we don’t have such problems anymore.

Another problem we had with our production web site is when we had a new version of a plugin and wanted to upgrade it. We uploaded the new assemblies and restarted the application BUT the old views were still used for some reason. To be honest we still don’t know why this happens even after several restarts of the server but we believe it is related to the Temp ASP.NET folder again. Unfortunately our hosting provider doesn’t allow us to see the Temp folder and they don’t tell us how we can clear it. So the solution we have found to this problem is to also update the Nop.Web.dll in the bin folder and somehow causing the Temp folder to be reinitialized.
We will be digging more into this and let you know if we can find what the real problem to this is.

Hope this helps!
Hace 12 años
7Spikes wrote:
NEVER copy any assembly in you plugin folder which is already present in the Nop.Web bin folder.

Fixed. Please see changeset fdd83abdeaac
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.