split assembly into two dlls?

G

Guest

We have a web app that has some data access code that will need to be used by
another process that will load data into the database from behind the scenes.

How can I "extract" just this piece of data access code from my project into
a seperate DLL so it can used by the other process? Do I have to create
another project for this common code and compile the solution creating two
dlls?

Thanks, Dave.
 
J

Juan T. Llibre

re:
Do I have to create another project for this common code
and compile the solution creating two dlls?

You could also compile them manually.

Split the source code into the appropiate sections, in .vb or .cs files;
open a command window ( cmd.exe ) and make sure that the .Net Framework
directory is in your path ( the .Net dir is where the vb and cs compilers are located ) ;
navigate to the directory where you have your .vb files, and run the compile command :

vbc /t:library /out:myFile.dll myFile.vb

myFile.dll will be created/compiled in the current directory.

Move the assembly to the /bin directory of your application and fire away.
If you want to have VS.NET use it, reference it in your project.

If you want to use C#, then the command line would be :

csc /t:library /out:myFile.dll myFile.cs

If you need to import .Net classes, include them in your command line:

vbc /t:library /r:system.dll /r:system.web.dll /out:common.dll common.vb
csc /t:library /r:system.data.dll /r:system.web.dll /out:common.dll common.cs
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top