I try to build and install nuget pack with c# proxy for c++ dll. So, when I install my pack to target project with Visual Studio 2019, it seems, that install is success. But I not see my c++ dll copied from nuget content to in project folder. My first version of nuget pack used build/Install.ps1, and it copied success my c++ dll to target project folder, but.. not for all projects. For example, when in VS2019 Nuget Package Manager I checked mark for target project with name like ProjectName - all is OK, Install.ps1 execute. But sometime projects in Nuget Package Manager have names like ProjectName\ProjectName.csproj - unfortunately, Install.ps1 not executed for such projects. This why I should to return to use targets files for copying. Ok, I created target file, pack my nuget packet and install it with VS2019 Nuget Package Manager. C++ dll not copied, but, repeat, packet was installed success. This is content of installed packed in solution package dir:
- Comp.Dep.NetClient.2.3.1
- build
- netstandard2.0
- Comp.Dep.NetClient.targets
- Comp.Dep.NetClient.props
- c++.dll (need to be copy to target project folder)
- lib
- netstandard2.0
- c#.dll (client proxy, added to project references)
- Comp.Dep.NetClient.2.3.1.nupkg
I tried many kinds of Comp.Dep.NetClient.targets content. I try to use Comp.Dep.NetClient.props instaed. Nothing help :) dll not copied. Now, my Comp.Dep.NetClient.targets and Comp.Dep.NetClient.props has next content:
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<NativeLibs Include="$(MSBuildThisFileDirectory)**\*.dll" />
<None Include="@(NativeLibs)">
<Link>%(RecursiveDir)%(FileName)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
I used different kinds from this https://qastack.ru/programming/19478775/add-native-files-from-nuget-package-to-project-output-directory ..and from this How can I set the 'copy to output directory' property in my nuspec file? ..and others :) nothing work.. For example, my target project structure after install pack is next:
- Solution dir
- packages
- Comp.Dep.NetClient.2.3.1
- ..(see structure on previous example)
- Comp.Dep.NetClient.2.3.1
- MyApp.sln
- MyApp (project dir)
- MyApp.csproj
- ...other files, but not c++ dll I expect that after install my nuget to MyApp project is success, my c++ dll will be copied to MyApp (project dir). But it not happens. Why??!!
- packages