Skip to main content
GameDev.net gamedev.net
🔒 Locked

[.net] sharing files between projects?

Started by gavco98 Apr 28, 2005 at 12:24 PM 4 replies 1.4k views
Original Post
gavco98
gavco98
Ive got a solution containing to projects, cleint and server. I want to put some common code into a single file, such as the message class, and share it between both projects? As soon as I add the file, it copies it into the project. Instead I want just one copy, so i just have to modify it once and it changes in both projects. Im using C# Express. How do I share files between projects?
Gavin Coates
[size="1"]IT Engineer / Web Developer / Aviation Consultant
[size="1"][ Taxiway Alpha ] [ Personal Home Page ]
Lundek
Lundek
Why not have the shared code in a class library and reference it in both projects?
Saruman
Saruman
Make a project named Common and add the file there. Than reference that project in both the Client and Server. I know I am just reiterating what Lundek said but I figured I would just straight out say what to do.. because I could have guessed the next question :)
developer
developer
I agree that having a common assembly would the preferred solution.

There's also an option if you use the "Open Existing Item" from the project menu (or right click the project and select to add existing item. In the "Add" dialog, select your foo.cs file. Rather than clicking the "Add" button, the add button also has a small arrow on it's right side. clicking that arrow will give you a "Add as link" option. That's probably what you're looking for.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.