By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,896 Members | 2,002 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,896 IT Pros & Developers. It's quick & easy.

Visual C# Express 'Include' libraries

P: n/a
Hi,

Is it possible in Visual C# Express to reference source files from a
folder other than the current project folder? I want to have a common
folder with various cs source files and be able to reference the files
from different projects. This will allow me to edit them as I develop
projects. Or do you have to compile the common code into a DLL or EXE
and reference them that way?

Thanks.

John.

Sep 26 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
John,

I don't know if you are able to use Express to compile dll libraries.
If not, then I would recommend compiling your classes into a library using
the command line compiler (look for information on CSC.exe) or, find a
project file for a dll library and modify it to use your files, and then use
MSBUILD to build it (the preferred method, it will make things much easier).

Then, you can reference your dll from your EXE project.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<Jo********@hotmail.co.ukwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
Hi,

Is it possible in Visual C# Express to reference source files from a
folder other than the current project folder? I want to have a common
folder with various cs source files and be able to reference the files
from different projects. This will allow me to edit them as I develop
projects. Or do you have to compile the common code into a DLL or EXE
and reference them that way?

Thanks.

John.

Sep 26 '06 #2

P: n/a
Hi,

Yes you can, select add an existing item and then instead of add click on
the little arrow and select link.

IMO this is not a good idea though . you can make changes from one project
to that file that can break other projects.
It's much better if you create a library project and then the others
projects just add a reference to it.
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

<Jo********@hotmail.co.ukwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
Hi,

Is it possible in Visual C# Express to reference source files from a
folder other than the current project folder? I want to have a common
folder with various cs source files and be able to reference the files
from different projects. This will allow me to edit them as I develop
projects. Or do you have to compile the common code into a DLL or EXE
and reference them that way?

Thanks.

John.

Sep 26 '06 #3

P: n/a
Ignacio,

Thanks for that tip re: the Add Link. That works a treat. I accept what
you say about the dangers but I was just wanting to do it this way for
the initial development and testing and didn't want to keep compiling a
DLL each time I wanted to make changes in the common code. The projects
I was referring to were just test projects anyway to help develop the
code.

John.
Ignacio Machin ( .NET/ C# MVP ) wrote:
Hi,

Yes you can, select add an existing item and then instead of add click on
the little arrow and select link.

IMO this is not a good idea though . you can make changes from one project
to that file that can break other projects.
It's much better if you create a library project and then the others
projects just add a reference to it.
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Sep 26 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.