views:

192

answers:

3

To start with, I don't know much of deployment. I hope my question makes sense.

I need to install/deploy a c# application to a number of desktops. It needs a third-party DLL : a c++ library ("lpsolve55.dll", for those interested, it is a free MIP/LP solver, see lpsolve.sourceforge.net/5.5/). I use it in my code in the following way:

    [DllImport("lpsolve55.dll", SetLastError = true)]
    public static extern bool add_column(int lp, double[] column);

For testing, I have manually copied the .dll file to to project\bin\release, it works fine.

My question: I will need an installer for the application, which will manage that the .dll will install as well. I am considering clickonce deployment since I am using visual studio express (2008), but any not too expensive solution will do.

What would you advice?

+1  A: 

If clickonce has the ability to carry that dll with it and copy it to the application folder, I would use it. It would be even better if it can check if the dll is present on the system (system32 folder) and use that then, so you don't have several versions of a binary on the target computer.

Femaref
+3  A: 

Just add your DLL to the project within Visual Studio.

  • Right click project in Solution Viewer
  • Select Add - Existing Item
  • Browse to the DLL and click Add or the little arrow next to the Add button and Add as Link
  • Select your DLL in the Solution Viewer
  • Right click it and select Properties
  • Set Build Action to Content
  • Set Copy to Output Directory to Copy if newer

Now your file will automatically be copied into the debug or release folder.

For deploying you can add a setup project to your solution. When you add the output of your first project to the setup project the DLL will automatically be added to the setup.

But a setup project is a completely new area. So start to work with it and ask a new question if you get stuck with it.

Oliver
+1  A: 

You can just include the dll in your project and deploy the whole thing with ClickOnce. Add it to your solution, set the build action to 'content'. Set 'copy to output directory' to 'copy always'. When you publish, you should be able to see the file in the publish folder. You can also check the Application Files dialog (in the publish tab of the project properties) to make sure it's going to be included.

RobinDotNet