Solved

Visual Studio moves files when adding them to a project

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

914 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now