ASP .NET: NuGet package does not copy the PDFNet folder to the bin directory when Publishing

33 views
Skip to first unread message

Yasser Khan

unread,
Jul 8, 2019, 9:40:48 PM7/8/19
to pdfne...@googlegroups.com
Question: 
ASP .NET Web Project: NuGet package does not copy the PDFNet folder to the bin directory when Publishing. Please help.

Answer:

​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

<Target Name="PDFNetFiles">
    <ItemGroup>
        <_CustomFiles Include="bin\**\*" />
        <FilesForPackagingFromProject Include="%(_CustomFiles.Identity)">
            <DestinationRelativePath>bin\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
        </FilesForPackagingFromProject>
    </ItemGroup>
</Target>

Under PropertyGroup:

<CopyAllFilesToSingleFolderForPackageDependsOn>
    PDFNetFiles;
    $(CopyAllFilesToSingleFolderForPackageDependsOn);
</CopyAllFilesToSingleFolderForPackageDependsOn>

<CopyAllFilesToSingleFolderForMsdeployDependsOn>
    PDFNetFiles;
    $(CopyAllFilesToSingleFolderForMsdeployDependsOn);
</CopyAllFilesToSingleFolderForMsdeployDependsOn>

ASP .NET Deploying extra files:
Reply all
Reply to author
Forward
0 new messages