Plugins\Bin RestSharp.dll keeps disappearing

6 months ago
I have a testing system that I am attempting to test a plugin on.

I have removed all plugins that use RestSharp except for the one being tested.

I have put restsharp.dll into folder manually.
I have restsharp.dll in plugin project.

What happens is as soon as I attempt to install plugin, the RestSharp dll in the \Plugins\Bin folder disappears.  Then I get this error -

ReflectionTypeLoadException: Unable to load one or more of the requested types.
Could not load file or assembly 'RestSharp, Version=106.12.0.0, Culture=neutral, PublicKeyToken=598062e77f915f75'. The system cannot find the file specified.

This is what is in csproj file -

<ItemGroup>
   <PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.2" />
   <Reference Include="RestSharp">
     <HintPath>..\Nop.Plugin.Widgets.OI\RestSharp.dll</HintPath>
     <CopyLocal>True</CopyLocal>
   </Reference>
</ItemGroup>

What could be causing the file to be removed?
6 months ago
What version of nopCommerce ?

Normally the the DLL would be in the Plugin Directory
i.e. Plugins\Widgets.OI\RestSharp.dll

in v4.6 I don't have a Plugins\Bin directory
6 months ago
Artdtc wrote:
I have a testing system that I am attempting to test a plugin on.

I have removed all plugins that use RestSharp except for the one being tested.

I have put restsharp.dll into folder manually.
I have restsharp.dll in plugin project.

What happens is as soon as I attempt to install plugin, the RestSharp dll in the \Plugins\Bin folder disappears.  Then I get this error -

ReflectionTypeLoadException: Unable to load one or more of the requested types.
Could not load file or assembly 'RestSharp, Version=106.12.0.0, Culture=neutral, PublicKeyToken=598062e77f915f75'. The system cannot find the file specified.

This is what is in csproj file -

<ItemGroup>
   <PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.2" />
   <Reference Include="RestSharp">
     <HintPath>..\Nop.Plugin.Widgets.OI\RestSharp.dll</HintPath>
     <CopyLocal>True</CopyLocal>
   </Reference>
</ItemGroup>

What could be causing the file to be removed?

After publishing the project, generally, I manually copy the nuget dll to the plugin folder. At development time do not face any issues.
6 months ago
Artdtc wrote:
...
I have put restsharp.dll into folder manually.
...

Why?  Just use NuGet.  Then you will have this in your .csproj file (example)
  <ItemGroup>
    <PackageReference Include="RestSharp" Version="106.12.0" />
  </ItemGroup>