Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie help, Inheriting code from different project in same solution

Status
Not open for further replies.

Crowley16

Technical User
Jan 21, 2004
6,931
GB
Hi Everybody.

I'm totally new to Visual Studios (2005) but have been given some development to do with it so please forgive me if my questions seem very trivial.

Currently I have a solution which contains 3 projects, I have been told to modify 1 of the 3 projects to include some error logging.

However in another project, there is already a logging class, and I should be reusing this class.

So, my question is, how do I get at the logging class from my project?

Note on my progress so far...
the logging class doesn't compile to a dll, I have used csc to generate a dll and added a reference to it but it doesn't seem to do anything when I call the logging functions.
Also, I would like to do this without modifying any of the other projects, i.e. without having to generate a dll from the logging class, is this possible?

Thanks

--------------------
Procrastinate Now!
 
Not modifying will not be an option but if you want to add logging without changing you projects to much then spring.net can help. Or other dependency Injection frameworks. Of course I would still recommend something like log4net to better control logging.

Christiaan Baes
Belgium

My Blog
"In a system where you can define a factor as part of a third factor, you need another layer to check the main layer in case the second layer is not the base unit." - jrbarnett
 
the logging routines have already been written, but it's in another project...

all I want to do is to bring that functionality back to this project, and if possible, without changing the other project to generate dlls

--------------------
Procrastinate Now!
 
Then copy paste will be the only option.

Christiaan Baes
Belgium

My Blog
"In a system where you can define a factor as part of a third factor, you need another layer to check the main layer in case the second layer is not the base unit." - jrbarnett
 
in that case, how do I tell Visual Studios to generate the dll for the logger.cs class file?

at the moment, it just creates on exec but no dlls, I would still need the exec but another dll just for the logger.cs class.

--------------------
Procrastinate Now!
 
I've manually created the dll and added a reference to it and it all seems to work now.

although still not sure how to get the project to autogenerate the dlls, is there like a makefile somewhere that needs editing?

--------------------
Procrastinate Now!
 
You need to use a special project type to create dll's. It is called a 'Class Library' project, IIRC.

Hope this help,s

Alex

[small]----signature below----[/small]
With all due respect, Don Bot, I don't think we should rely on an accident happening. Let's kill him ourselves.

Ignorance of certain subjects is a great part of wisdom
 
You could do it by changing the csproj file from you project and adding an extra buildcommand for the other project. The csproj files are nothing more then msbuild files, open them in notepad to see. Or you could just copy it and make your own build file which sounds better to me.

Christiaan Baes
Belgium

My Blog
"In a system where you can define a factor as part of a third factor, you need another layer to check the main layer in case the second layer is not the base unit." - jrbarnett
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top