Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to export class libraries in Visual Studio 2012

In Eclipse when I implement a class library and I'm ready to deploy, I usually export and package it into a JAR file that later you can just add to the build path in another project. Is there an equivalent feature in Visual Studio? Is there a proper way to "publish" a class library and package it into a dll file to later add as a reference in another project? Or do you just usually go and dig for it in the bin folder yourself?

like image 216
AxiomaticNexus Avatar asked Dec 12 '22 11:12

AxiomaticNexus


2 Answers

Most VS projects compile into a DLL. If you want your DLL to be "published" to some particular location when you build, you can use build events which can also package up your dll (you could call a batch script, for example, that takes care of that for you).

Is there a proper way to "publish" a class library and package it into a dll file to later add as a reference in another project? Or do you just usually go and dig for it in the bin folder yourself?

Sure, just add the bin\debug\yourdll.dll or bin\release\yourdll.dll as a reference in your other project, or otherwise to the location you moved it to in your build event. No need to go digging for it every time.

like image 173
tnw Avatar answered Dec 23 '22 09:12

tnw


  1. Change the output type to 'release' or 'Debug'.
  2. Go to Build, Build Solution (Or f5)
  3. Navigate to: The Solution Bin folder for release or debug.

    3a. You can quickly navigate to the solution folder by right clicking the solution in the
    'Solution explorer' and selecting 'Open folder in File Explorer'. The compiled DLL file will be in that directory. (bin\release or bin\debug)

like image 21
Botonomous Avatar answered Dec 23 '22 08:12

Botonomous