In order to achieve this, you should create a <package_id>.props file which can copy these files into the target path as you want.
1) In your MyPlugin library project, you should create a file called <package_id>.props
under Build folder.

then add these content in that new file:
<Project>
<Target Name="CopyToFolder" BeforeTargets="Build">
<ItemGroup>
<Files Include="$(MSBuildThisFileDirectory)..\File\*.*"></Files>
</ItemGroup>
<Copy SourceFiles="@(Files)" DestinationFolder="$(ProjectDir)bin\Plugin"></Copy>
</Target>
</Project>
2) add these node in your MyPlugin.csproj
file:
<ItemGroup>
<None Include="xxx\MyPlugin.dll(the path of MyPlugin.dll in your project)" Pack="true" PackagePath="File"></None>
<None Include="xxx\MyPlugin.config(the path of MyPlugin.dll in your project)" Pack="true" PackagePath="File"></None>
<None Include="Build\MyPlugin.props" Pack="true" PackagePath="build"></None>
</ItemGroup>
3) the repack MyPlugin project by click Pack menu. And before you install this new version of nuget package, you should first clean nuget caches or delete all caches files under C:\Users\xxx(current user)\.nuget\packages
.
Besides, there is also a similar thread you can refer to.
===================================================
Update 1
For Step 1 description:
The .props
file must be named as your package_id
so that it will work on the nuget nupkg file. Please see my link which I provided on the above.
For an example, if you nuget package is named as MyPlugin.1.0.0.nupkg
, so the props file should be named as MyPlugin.props
file. The propose of the target is copy the files from the File folder of the nupkg into the target main project's bin\Plugin
folder.
For Step 2 description:
The steps pack the content of your MyPlugin project files into the nupkg.
So if your MyPlugin.config
is under bin\Release folder of your MyPlugin project, you should use:
<None Include="bin\Release\netstandard2.0\MyPlugin.config(the path of MyPlugin.dll in your project)" Pack="true" PackagePath="File"></None>
You should make sure that bin\Release\netstandard2.0\MyPlugin.config
is right and you can find the file due to its relative path(compare with the path of csproj file).
PackagePath="File" means that it should pack MyPlugin.config
file into File folder of the nupkg.
<None Include="Build\MyPlugin.props" Pack="true" PackagePath="build"></None>
This step is to pack MyPlugin.props
into build folder of nupkg file. Please see this document,
Build\MyPlugin.props
means the file physcial path of MyPlugin.props
in your MyPlugin project so that nuget will find the file.
The build folder of nupkg (3.x+) MSBuild .targets and .props files Automatically inserted into the project.
So it is the function of nupkg.
Anyway, this step can be checked by yourself, please check whether the path of the files are correct and then make sure that the target files exist on the File folder of nupkg.
This is my nupkg structure:



=======================================================================
Also, before you install this new version of nuget package, you should clean nuget caches first to remove the old ones in case you still install the old one.
After that, build your main project first to execute the target and then you will see the effect as I show here.

