Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Visual Studio moves files when adding them to a project

Posted on 2006-07-19
4
Medium Priority
?
300 Views
Last Modified: 2010-04-16
Hi,

I have a C#project created in Visual Studio 2005. I have a common Settings.cs file that is used in multiple projects. When I add it to a new project, it copies the Settings.cs file from the Common folder to the new project folder.

How do I stop it from doing this?

0
Comment
Question by:WallaceAdrian
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 11

Expert Comment

by:Agarici
ID: 17137217
i dont think you can. (this not copy thing is specific to vs6.0 and .net does not use the same concept)
if you need to use it in multiple projects, compile it into a dll and add a reference to that dll to all the projects you need.

hth,
A.
 
0
 
LVL 12

Accepted Solution

by:
andrewjb earned 500 total points
ID: 17137320
When adding it, on the 'Add to project' open dialog, click the little arrow next to the 'Add' button and choose 'Add as Link'

But you probably don't want to add the same file to multiple projects in the same solution.. Sounds like it might be a bad design if you do..
0
 
LVL 13

Expert Comment

by:devsolns
ID: 17137616
A versioned strong named assembly would be a much better approach then sharing a .cs file among projects.
0
 
LVL 2

Author Comment

by:WallaceAdrian
ID: 17137634
It is a common file used in different solutions.

How would this work if you had 50 or more .CS files in a project. It would make sence (to me anyway) to seperate them into a few seperate folders rather than lump them all together in one folder?

Perhaps it's just me?
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question