Structure
I have something like
(A) SharedLib
which references Nop.Web
(B) Plugin uses SharedLib
And when I build them and run Nop.Web, duplicate assembly error is thrown and can’t procceed.
When I dig a bit deeper, I found that under (B)’s build output, there’s a Plugins
folder and among all other output SharedLib
‘s binary is in it, this is where the duplication is.
Solution
So I have to reference Nop.Web
but I do not want its output in my plugin’s output.
In (A)SharedLib
Instead referencing Nop.Web
this way:
<ProjectReference Include="..\..\Presentation\Nop.Web\Nop.Web.csproj" >
We use this:
<ItemGroup>
<ProjectReference Include="..\..\Presentation\Nop.Web\Nop.Web.csproj" >
<Private>false</Private>
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
In (B)
Reference SharedLib
:
<ItemGroup>
<ProjectReference Include="..\Nop.Plugin.SharedLib\Nop.Plugin.Rsc.SharedLib">
<Private>false</Private>
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
</ProjectReference>
<ClearPluginAssemblies Include="$(MSBuildProjectDirectory)\..\..\Build\ClearPluginAssemblies.proj" />
</ItemGroup>
And also prevent Nop.Web
‘s output to be copied:
<ItemGroup>
<ProjectReference Include="..\..\Presentation\Nop.Web\Nop.Web.csproj">
<Private>false</Private>
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
контрреволюция
嗷嗷牛逼
Everything is very open with a really clear clarification of the challenges. It was definitely informative. Your site is very helpful. Thank you for sharing! Hollie Skell Grew
Very informative blog article. Much thanks again. Much obliged. Katha Winnie Eckhardt
Hi,
You haven’t update your web very long time, are you good bro?
Kudos for detailing this topic. Do you plan to write more? Ilsa Granthem Glasgo