0

I have a web project (MVC), which uses one native library (the ghostscript library).

Though my code, I am referencing this library with the DLLImport attribute

[DllImport("gsdll64.dll", EntryPoint = "gsapi_new_instance")]
private static extern int gsapi_new_instance (out IntPtr pinstance, IntPtr caller_handle);

Now I need to deploy this web application. How to deploy the native DLL as well? I am not referencing it like a normal managed library and I am a bit confused about the deploying.

Dimitar Tsonev
  • 3,711
  • 5
  • 40
  • 70

1 Answers1

0

One way is to add the library to your web project that you are deploying. Then you can change the "Build action", and "Copy to output" in the properties to match your needs (e.g. "None" and "Copy if newer"). You can use that to make the dll or any other file in fact to be deployed.

enter image description here

You can also try to add a post-build action like in this question.

Community
  • 1
  • 1
Ilya Chernomordik
  • 27,817
  • 27
  • 121
  • 207