Solved

Visual Studio moves files when adding them to a project

Posted on 2006-07-19
4
291 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
c# string 6 39
Convert VB6 MSXML2.ServerXMLHTTP process to C# 2 32
C# Export DataGridView 4 37
Long URL in SMS 6 22
Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
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!
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

772 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

11 Experts available now in Live!

Get 1:1 Help Now