Plugin development: How to make changes take effect after modification?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
10 years ago
Hi,
I'm developing a bespoke bit of function as a plugin (previously it was implemented as a modification to core code) however I'm finding the process really frustrating, either due to caching, or how plugins are loaded/reloaded.

I followed the plugin development guide on this site but I can't figure a reliable/consistent way to make the site use the newly compiled version of a plugin after I've changed either the .cs or the .cshtml views.

What minimum set of steps to force NopCommerce to use the last compiled version of a plugin?   Doing a full clean/rebuild cycle and then restarting the website seems to work but this whole process takes AGES on my machine and often all I've changed is a bit of HTML in one of the plugin's Views.  

Bearing in mind this plugin is for our internal only (it won't be published elsewhere) is there a way to streamline this process so that changes to views are picked up in realtime without a recompile being needed (ie the .cshtml files are physically deployed to the plugin folder instead of the views being an embedded resource in the DLL). Is this possible?

Thanks!
Nick
10 years ago
That's the only way. But please note that there's no need to rebuild the entire solution. Do it only for a modified plugin
10 years ago
I'm not finding that rebuilding a plugin, and then refreshing the page has any affect.

If I change the code, compile the plugin and reload the page (and do nothing else), it runs the old version of the code.

Am I missing a step?
10 years ago
Hi

I am interested in an answer to this,  here is what I have found, I am using Visual Studio to develop plugins.


So I make changes to the plugin source code or the description text file,  and then Clean and Rebuild the plugin project, this works fine. the rebuilt plugin dll and description text file get transfered to the Presentation/Nop.Web/Plugin/Widgets.MyPlugin

So where I have the problem is the same as you in that all other files do not get transfered to the Presentation/Nop.Web/Plugin/Widgets.MyPlugin folder either when the plugin is Cleaned and Rebuilt or the Nop.Web project or Solution is Rebuilt.

I have not been able to find what I have missed so far, as third party plugins seem to work fine if make a change to css file etc and the changed file is transfered.


So the way I have got round it for the time being is to install the plugin on my development server local version of Nop and then make style changes to the css file, that way I can refresh the web page of the plugin and see the changes, if I need to change the views, it's back to VS make changes and reistall and try again. :o(

Or copy and paste the change css file directly into the Presentation/Nop.Web/Plugin/Widgets.MyPlugin in Visual Studio :o(
10 years ago
Rebuilding a plugin project always worked for me
10 years ago
I'm seeing similar behaviour to Spire.  Changing plugins and rebuilding them often has no effect at all - the old code still executes and the old resources (views) are still used.  Clicking the "reload list of plugins" seems to help sometimes but it's not consistent.  Usually after rebuilding the plugin, there isn't even a delay when refreshing the site (which would be the give away that's doing some recompilation).
10 years ago
Try clearing the C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files directory. Or manually delete all directories in the \Nop.Web\Plugin one
6 years ago
This fixed the problem for me: https://www.nopcommerce.com/boards/t/24821/old-version-of-my-code-returns-after-some-hours.aspx#188401
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.