Why doesn't ASP.NET NuGet package copy the PDFNet folder to the bin directory when publishing?

To get the files copied to the Publish Target Location, please make the following changes:

  1. In your References, please set "Copy Local" property of PDFNet.dll to "True"​
  2. Add the following to PublishProfile i.e. *.pubxml

XML

1<Target Name="PDFNetFiles">
2 <ItemGroup>
3 <_CustomFiles Include="bin\**\*" />
4 <FilesForPackagingFromProject Include="%(_CustomFiles.Identity)">
5 <DestinationRelativePath>bin\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
6 </FilesForPackagingFromProject>
7 </ItemGroup>
8</Target>

Under PropertyGroup:

XML

1<CopyAllFilesToSingleFolderForPackageDependsOn>
2 PDFNetFiles;
3 $(CopyAllFilesToSingleFolderForPackageDependsOn);
4</CopyAllFilesToSingleFolderForPackageDependsOn>
5
6<CopyAllFilesToSingleFolderForMsdeployDependsOn>
7 PDFNetFiles;
8 $(CopyAllFilesToSingleFolderForMsdeployDependsOn);
9</CopyAllFilesToSingleFolderForMsdeployDependsOn>

Please read more about deploying extra files with ASP.NET.

Did you find this helpful?

Trial setup questions?

Ask experts on Discord

Need other help?

Contact Support

Pricing or product questions?

Contact Sales