-
Notifications
You must be signed in to change notification settings - Fork 100
Description
Hi, I'm using GhostScriptSharp v1.3.1.4 and I've run into an issue when publishing a ASP.NET project.
The post-build event script only works locally.
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "ls '$(SolutionDir)\packages\GhostScriptSharp.*\Tools\gsdll32.dll' | Sort -Descending | Select -First 1 | cp -Destination '$(TargetDir)'; exit 0"
So when the project is published the gsdll32.dll is missing on the server :(
However I found a solution. Inspired from https://docs.microsoft.com/en-us/aspnet/web-forms/overview/deployment/visual-studio-web-deployment/deploying-extra-files
You can add the following to the publish profile.
<Target Name="CustomCollectFiles">
<ItemGroup>
<_CustomFiles Include="..\packages\GhostScriptSharp.*\Tools\gsdll32.dll" />
<FilesForPackagingFromProject Include="%(_CustomFiles.Identity)">
<DestinationRelativePath>bin\%(Filename)%(Extension)</DestinationRelativePath>
</FilesForPackagingFromProject>
</ItemGroup>
</Target>
<PropertyGroup>
<CopyAllFilesToSingleFolderForPackageDependsOn>
CustomCollectFiles;
$(CopyAllFilesToSingleFolderForPackageDependsOn);
</CopyAllFilesToSingleFolderForPackageDependsOn>
<CopyAllFilesToSingleFolderForMsdeployDependsOn>
CustomCollectFiles;
$(CopyAllFilesToSingleFolderForPackageDependsOn);
</CopyAllFilesToSingleFolderForMsdeployDependsOn>
</PropertyGroup>
And now the gsdll32.dll file is published along the other files. 🎉
Not sure if this somehow can be improved upon so this manual edit isn't necessary.