views:

1704

answers:

4

I have a DLL I need to deploy with my C# application. It's not currently included in the installation package when I hit "Publish" so how do I include it?

Would the process be any different if I had app.config and other files I wanted to deploy with my application?

+1  A: 

Can't you add the dll as a resource to your installer project?

Andrew Siemer
Perhaps, how do I go about doing that? Assume I'm new to VS...
Adam Davis
+3  A: 

If it's referenced it should be included automatically. I've deployed a couple of apps that require a 3rd party dll and they've published OK.

Is the dll referenced correctly in your project? That's the only thing I can think of at the moment that might be the problem, but if it wasn't your code wouldn't compile and/or link anyway.

EDIT: To get the xls file to deploy I think all you need to do is add the file to the solution and then set the "Copy to Output Directory" property on the file. (I haven't tried this yet so it might not work).

ChrisF
Ok, the DLL is being included, but the xls is not. Is there something special I need to do to have the excel spreadsheet deployed with the software?
Adam Davis
+2  A: 

I take it you are using Visual Studio?

If your using Visual Studio 2008 (I have no experience with Visual Studio 2005) under the Publish tab in your project properties click on the Application Files button. This will bring up a list of all dependencies assembalies required by your project. If you find that required dll is not being published by the Visual Studio publisher tool by default you can go into here and set the Publish Status of the offending dll to Include.

Sometimes in my more complicated projects, depending on the type of dependency, I have to go into this menu and force certain dll's to be included opposed to the default Prerequsite setting.

...but this is all under the assumption you have the assembly properly referenced in the required projects and everything is compiling fine.

Matthew Ruston