Solved

Visual Studio moves files when adding them to a project

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

705 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