Plugin Output Directory Pulling in Nop.Web Directories

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
4 years ago
('clean it' (delete files) manually.  In VS, if you fixed some 'copy local' settings on your dependencies before you Clean'd, then VS won't know to remove them.)
4 years ago
New York wrote:
('clean it' (delete files) manually.  In VS, if you fixed some 'copy local' settings on your dependencies before you Clean'd, then VS won't know to remove them.)

I am not following what you mean. Like Simon and the OP, every time I build my plugin project I am left with the following folders in the output folder in Nop.Web.Plugins.MyPlugin:

App_Data
Areas
Plugins
Properties
Themes

Are you suggesting we are doing something that keeps allowing these folders to hang around after a build?
4 years ago
If I set Local Copy equal No for the reference to the Nop.Web project in my plug-in and I build it there is no problem, but now in the plug-in folder create a new folder structure called "runtimes" and subfolders. .. unix, win, win- arm etc. some idea?
It also happens with the Tax Avalara plugin. I am using visual studio 2019.
4 years ago
Replying to Mitch -

Yes, I've cleaned the solution, deleted bin and obj directories, the Nop.Web/plugin directory.  I've done that multiple times, both before and after checking that copy local was set to false for all dependencies and references.

I have two other self-developed plugins that don't have this problem, but they are much smaller.
4 years ago
I too am having same issue. Just came across this morning
4 years ago
What part of the build process governs what gets copied and or cleaned? I have some time to debug this, I just need to know where to start.
4 years ago
OK, I've managed to figure out where I went wrong.  My plugin was fine, but I had one of its dependencies set up incorrectly.

The dependency (Blogifier.Core) has dependencies on Nop.Web and Nop.Web.Framework and these did not have Copy Local set to false. Building this project created the extra folders.

Since my plugin does create a local copy of Blogifier.Core, it pulled in all these extra folders as part of that process.

In the end that was an easy fix.

If you're still having this problem for any other reason that you haven't figured out yet, there is a simple workaround that will save you from having to manually delete the extra folders and files. Change your Plugin.csproj file to delete them after building, like this:


  <!-- This target execute after "Build" target -->
  <Target Name="NopTarget" AfterTargets="Build">
    <!-- Delete unnecessary libraries from plugins path -->
    <MSBuild Projects="@(ClearPluginAssemblies)" Properties="PluginPath=$(MSBuildProjectDirectory)\$(OutDir)" Targets="NopClear" />
    <!-- Delete extra folders and files from plugin output directory -->
    <RemoveDir Directories="$(OutDir)\App_Data;$(OutDir)\Areas;$(OutDir)\Plugins;$(OutDir)\Themes" />
    <Delete Files="$(OutDir)\appSsettings.json;$(OutDir)\appsettings.Development.json;$(OutDir)\web.config"/>
  </Target>


All the best,
Simon

portraitsbysimonbland.com
3 years ago
Checking the forum and realize many people are facing this issues. After did some research, I had solve my issue just by setting the CopyLocalLockFileAssemblies to false in plugin folder, where these two plugin is set to true default, difference from others. And rebuild this plugin folder and it done the magic.

Payments.Square
Tax.Avalara

<CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>
3 years ago
The best solution I have found is to set "Copy Local" to "No" in the property page for the project dependency.  I will do this primarily for Nop.Web.

Seems to solve the issue for me.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.