SevenZipSharp.Interop icon indicating copy to clipboard operation
SevenZipSharp.Interop copied to clipboard

cant deploy on azure webapp

Open richardNieuwlandAlten opened this issue 2 years ago • 2 comments

Hi, i like to run a command line app in the cloud, but the 7z.dll which is added by me to the project with 'always copy' doesn't end up in the target folder on the webapp after publish. That way, preventing the app to run. Any clue what i need to set in my vs project to use the 7dll that way ? Note: the same happend when i was trying to use the 7dll in an Azure Function.

richardNieuwlandAlten avatar Mar 21 '22 09:03 richardNieuwlandAlten

The always copy flag copies files to the Bin folder, you can try to set the build action as content to have the file available during publish.

luuksommers avatar Aug 01 '22 20:08 luuksommers

Try adding a section as follows to your csproj:

  <Target Name="CopySevenZipForPublish" BeforeTargets="PrepareForPublish">
    <Message Importance="high" Text="Copying 7-zip DLLs" />
    <Copy SourceFiles="@(SevenZipSharpInteropFiles)"
          DestinationFiles="@(SevenZipSharpInteropFiles -> '$(PublishDir)%(RecursiveDir)%(Filename)%(Extension)')" />
  </Target>

chucker avatar Nov 07 '22 15:11 chucker