Automatic native and managed DLLs extracting from Nuget Package

I will try to explain all the pain and solutions I’ve been through as detailed as possible. In my example I use simple text files AAA86.txt, AAA64.txt and AAAany.txt instead of native DLLs to simply demonstrate the extraction process. First thing you need to know: If you try to mix the native NuGet’s architecture with … Read more

Build NuGet Package automatically including referenced dependencies

Your point #3 (Add references to various .dll files/other projects <– this is the missing part) really contains two different issues: (1) add references to various dll files, and (2) add references to other projects in the same solution. Number (2) here has gotten some added support as of NuGet 2.5. You can add an … Read more

Loading Assemblies from NuGet Packages

crownedjitter’s helpful answer is a good starting point, and Travis himself has provided additional pointers in comments, but let me try to summarize as of Windows PowerShell v5.1 / PowerShell [Core] 7.1: Update: The original answer, reprinted in the section after this one, contains some useful general pointers, plus a link to the feature suggestion … Read more

Setting up a common nuget packages folder for all solutions when some projects are included in multiple solutions

I have a similar situation with external and internal package sources with projects referenced in more than one solution. I just got this working with one of our code bases today and it seems to be working with the developer workstations and our build server. The below process has this scenario in mind (although it … Read more

Add native files from NuGet package to project output directory

Using the Copy target in the targets file to copy required libraries won’t copy those files to other projects which reference the project, resulting in a DllNotFoundException. This can be done with a much simpler targets file though, using a None element, as MSBuild will copy all None files to referencing projects. <Project xmlns=”http://schemas.microsoft.com/developer/msbuild/2003″> <ItemGroup> … Read more

Set content files to “copy local : always” in a nuget package

Instead of using a PowerShell script another approach is to use an MSBuild targets or props file with the same name as the package id: <Project xmlns=”http://schemas.microsoft.com/developer/msbuild/2003″> <ItemGroup> <None Include=”$(MSBuildThisFileDirectory)importantfile.xml”> <Link>importantfile.xml</Link> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> </ItemGroup> </Project> In the nuspec file then, instead of adding the required files to the Content directory, add them to the Build … Read more