Unnecessary dll when plugin reference to another plugin

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
2 anni tempo fa
Hi,

I have a custom plugin that referenced to a pickup plugin and another shipping plugin referenced to the custom plugin. I have illustrate the relation as per below :
pickup plugin -> custom plugin -> shipping plugin
When i build the shipping plugin I have the following
/refs/customPlugin.dll
pickup.dll
shipping.dll

Is there anyway to move plugin.dll to be inside refs folder as well?
Here is my csproj
<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net5.0</TargetFramework>
    <Copyright></Copyright>
    <Company></Company>
    <Authors></Authors>
    <PackageLicenseUrl></PackageLicenseUrl>
    <OutputPath>..\..\Presentation\Nop.Web\Plugins\Shipping.FixedByWeightByTotal</OutputPath>
    <OutDir>$(OutputPath)</OutDir>
    <!--Set this parameter to true to get the dlls copied from the NuGet cache to the output of your project.
    You need to set this parameter to true if your plugin has a nuget package
    to ensure that the dlls copied from the NuGet cache to the output of your project-->
    <CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>
  </PropertyGroup>

  <ItemGroup>
    <ProjectReference Include="..\..\Presentation\Nop.Web\Nop.Web.csproj" />
    <ProjectReference Include="..\CustomPlugin\CustomPlugin.csproj">
      <Private>false</Private>
      <CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
    </ProjectReference>
    <ClearPluginAssemblies Include="$(MSBuildProjectDirectory)\..\..\Build\ClearPluginAssemblies.proj" />
  </ItemGroup>
  
  <ItemGroup>
    <Content Include="logo.jpg">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </Content>
    <Content Include="plugin.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </Content>
    <Content Include="Views\AddRateByWeightByTotalPopup.cshtml">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </Content>
    <Content Include="Views\Configure.cshtml">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </Content>
    <Content Include="Views\EditRateByWeightByTotalPopup.cshtml">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </Content>
    <Content Include="Views\_ByWeightByTotal.cshtml">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </Content>
    <Content Include="Views\_CreateOrUpdateRateByWeightByTotal.cshtml">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </Content>
    <Content Include="Views\_FixedRate.cshtml">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </Content>
    <Content Include="Views\_ViewImports.cshtml">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </Content>
  </ItemGroup>

  <!-- 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" />
  </Target>

</Project>



P/S : This is what I got when i build custom plugin
/refs/pickup.dll
customPlugin.dll
2 anni tempo fa
On shipping plugin add pickup plugin as the reference as well, and make copy local to No.
On csproj

<ProjectReference Include="..\Nop.Plugin.Pickup.PickupInStore\Nop.Plugin.Pickup.PickupInStore.csproj">
      <Private>false</Private>
</ProjectReference>


Hope it will resolve your problem, let me know if not solved yet.
2 anni tempo fa
Hi rmahbub63,

Yes it does works when I reference to pickup project and set copy to local = false. I guess there is no other way than doing so. Thanks
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.