Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

How to get nuget package to include non dll in publish output

$
0
0

I'm using the Select.HtmlToPdf which requires Select.Html.dep file to be located in the same directory asSelect.HtmlToPdf.dll, but I'm finding it missing from publish output. I notice the nuget package tries to include a .targets file:

<?xml version="1.0" encoding="utf-8"?><Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"><ItemGroup><AvailableItemName Include="Dependencies" /></ItemGroup><ItemGroup><Dependencies Include="$(MSBuildThisFileDirectory)dep\*"><TargetPath></TargetPath></Dependencies></ItemGroup>  <PropertyGroup><PrepareForRunDependsOn>$(PrepareForRunDependsOn);
      CopyDependencies</PrepareForRunDependsOn></PropertyGroup><Target Name="CopyDependencies" DependsOnTargets="CopyFilesToOutputDirectory"><Copy SourceFiles="@(Dependencies)"
          DestinationFiles="@(Dependencies->'$(OutDir)\%(Filename)%(Extension)')"
          Condition=""><Output TaskParameter="DestinationFiles" ItemName="FileWrites" /></Copy></Target>  </Project>

Which doesn't work, and I used to resort to adding this in my app.pubxml file:

<Target Name="CustomCollectFiles"><ItemGroup><_CustomFiles Include="bin\Select.Html.dep" /><FilesForPackagingFromProject Include="%(_CustomFiles.Identity)"><DestinationRelativePath>bin\Select.Html.dep</DestinationRelativePath></FilesForPackagingFromProject></ItemGroup></Target><PropertyGroup><CopyAllFilesToSingleFolderForPackageDependsOn>CustomCollectFiles</CopyAllFilesToSingleFolderForPackageDependsOn><CopyAllFilesToSingleFolderForMsdeployDependsOn>CustomCollectFiles</CopyAllFilesToSingleFolderForMsdeployDependsOn></PropertyGroup>

In ASP.NET 4.5 apps, but not sure how to change this to the work with new ASP.NET 5 apps (it needs to be output toapproot\packages\Select.HtmlToPdf\1.2.0\lib\net40). If this could be fixed at the nuget package level for both 4.5 and 5 apps that'd be ideal I can go back to package author with the fix, but if I could alter my app to copy file to publish output that'd be good.


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>