Solved

Visual Studio moves files when adding them to a project

Posted on 2006-07-19
4
297 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 125 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

733 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