Folder ABCpdf nuget Is the XULRunner folder damaged?

I am trying to update my (previously working) pdf web application for using the ABCpdf.NET and ABCpdf.NET Gecko Runtime nuget packages.

I installed both packages (both versions 8.1.1.6), however when I launch my application I get the following WebSupergoo.ABCpdf8.Internal.PDFException :

Failed to add HTML: Gecko engine received an error that it could not recover from. Possible reasons: the XULRunner folder is damaged or from another version of ABCpdf.

After installing the ABCpdf.NET Gecko Runtime package, I got a dialog box saying that I need to manually copy the XULRunner folder to my output directory. To do this, I added a .csproj file to my applications:

<Target Name="AfterBuild"> <CallTarget Targets="CopyAbcpdfToDeployFolder" /> </Target> <Target Name="CopyAbcpdfToDeployFolder"> <ItemGroup> <SourceDir Include="$(ProjectDir)XULRunner\**\*.*" /> </ItemGroup> <Copy SourceFiles="@(SourceDir)" DestinationFolder="$(WebProjectOutputDir)\$(OutputPath)%(SourceDir.RecursiveDir)\XULRunner" /> </Target> 

(It seems to work correctly - the XULRunner folder and its contents are present in my bin folder after assembly)

The line of the faulty code is as follows:

 theDoc.AddImageUrl(url); 

Can someone help me get this job?

+3
source share
2 answers

As it turned out, my changes to the .csproj file .csproj not copy all the files to the correct subfolders. To copy the folder structure and files recursively, the XML should look like this:

  <Target Name="AfterBuild"> <CallTarget Targets="CopyXULRunnerToDeployFolder" /> </Target> <Target Name="CopyXULRunnerToDeployFolder"> <ItemGroup> <MyFiles Include="XULRunner\**\*.*" /> </ItemGroup> <Microsoft.Build.Tasks.Copy SourceFiles="@(MyFiles)" DestinationFiles="@(MyFiles->'$(OutputPath)\XULRunner\%(RecursiveDir)%(Filename)%(Extension)')"/> </Target> 
+5
source

I was able to accomplish the same result with the following MSBuild xml:

 <ItemGroup> <Content Include="XULRunner\**\*.*"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </Content> </ItemGroup> 

I came across this installation after resolving issues related to creating a package through MSDeploy, not including XULRunner files.

I'm not sure if something is clearly wrong with this, but so far it works for me in an installation with several deployment steps.

+2
source

All Articles