473,785 Members | 3,388 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sharing Source Code Across Different Solutions

I have common classes that I would like to share amongst a few stand
alone projects. They are independent of each other and not related in
any way. For the life of me, I cannot figure out how to share a
single source code file amongst multiple projects. When I attempt to
add an existing item to a project, Visual Studio makes a copy of the
file. I do not want ten copies of the same source code that I later
have to maintain.

I tried editing the file name and adding ..\Common\whate ver.vb, but
this is not permitted. It seems like such a simple thing that I
should not be struggling with.

Any help would be appreciated.

Thanks.
Jul 15 '07 #1
5 1273
ja***@onepost.n et wrote in news:at******** *************** *********@4ax.c om:
I have common classes that I would like to share amongst a few stand
alone projects. They are independent of each other and not related in
any way. For the life of me, I cannot figure out how to share a
single source code file amongst multiple projects.
Create a library (DLL).
Jul 15 '07 #2
<ja***@onepost. netschrieb:
[...] I cannot figure out how to share a
single source code file amongst multiple projects. When I attempt to
add an existing item to a project, Visual Studio makes a copy of the
file. I do not want ten copies of the same source code that I later
have to maintain.
Click "Add Existing Item...", select the file, and then change the
dropdown button to reference the file only and keep it in its original
location.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Jul 15 '07 #3
On Sun, 15 Jul 2007 19:39:31 +0200, "Herfried K. Wagner [MVP]"
<hi************ ***@gmx.atwrote :
>Click "Add Existing Item...", select the file, and then change the
dropdown button to reference the file only and keep it in its original
location.
Interesting -- I do not have these options after clicking Add Existing
Item.

Ah -- I just found it. There's a drop down arrow to the right of the
Add button. I have to select "Add As Link."

Thanks!
Jul 15 '07 #4
On Sun, 15 Jul 2007 17:37:27 GMT, Spam Catcher
<sp**********@r ogers.comwrote:

>Create a library (DLL).
Yeah -- this would have been my last resort. I have the source shared
now though.
Jul 15 '07 #5
ja***@onepost.n et wrote in news:vm******** *************** *********@4ax.c om:
On Sun, 15 Jul 2007 17:37:27 GMT, Spam Catcher
<sp**********@r ogers.comwrote:

>>Create a library (DLL).

Yeah -- this would have been my last resort. I have the source shared
now though.
It's probably the best way too :-)
Jul 15 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1951
by: Simon Neve | last post by:
Hello, This question is related to sharing .Net projects across solutions and is reposted from the SourceSafe group. We have several different solutions and want to share common assemblies across them. Is it best to share the project and its files to each solution (each solution has it's own shared project), or have each solution point to the same file location of the project?
7
3107
by: Dan | last post by:
I'd like to have a set of more-or-less common code which I want to use for both desktop and smart device projects. I have two questions: 1. How can I set up conditional compile directives for those parts of the code which are different on desktop and smart device projects 2. How can I actually share the same .cs source code files between the two projects. If I try to open a smart device project and add the files which are in the...
5
8543
by: geoffblanduk_nospam | last post by:
Is it valid to share namespaces across projects in C#? For example, I have a project that contains the code for a core assembly, this builds a DLL. I then have a second project in the same solution that contains test cases for the assembly in the same namespace, this references the first project's DLL and builds a further DLL for testing. All code has the same namespace. The code in the tests needs access to internal methods etc of the...
0
1279
by: John Lafrowda | last post by:
Dear all, here is a simple problem that I cannot overcome: I'm trying to write a client/server application in Visual Basic .net. The server is an executable (.exe) project, the clients are class library (.dll) projects. The server loads the clients from their DLL-files at runtime using reflection tools, such as: ClientAssembly = System.Reflection.Assembly.LoadFrom(Client_To_Load_File_Name)
2
1717
by: Carlo \(MCP only\) | last post by:
Hi to all I'm askyng you a suggestion about the best way to share the same source code between VS2003 and VS2005. The project I'm developing is a controls and components library, and the Solution.sln includes a standard WindowsForms application for testing pourposes. What I need is an efficient and reliable way to edit and test the DLL assembly in both environments, since the library will be distributed for Framework 1.1 and 2.0.
2
2744
by: Chris Fink | last post by:
What is the recommendation for sharing master pages across IIS Servers? In our corporation, we have many webservers in different environments (intranet, extranet, etc). I've done some searching, and it appears as though the solutions are focused only around one IIS instance, by installing the controls (master pages) in the GAC. This solution would require me to install the controls in more than 1 dozen servers each time.... I would think...
1
1528
by: Matt Owens | last post by:
Hi, Im setting up a new project in which I'd like to share code across numerous other projects, specifically a control library and an array of common objects. Im not really sure how best to go about this, i've done this two ways in the past and both have proved a little problematic. 1) Create a new solution in a common area with a common name for all projects to share. This is fine, although there's the overhead of
2
1972
by: Jeff Dege | last post by:
I'm working with a group that's been doing C++ coding for quite a long time, now, and in that environment we've pretty much worked out development practices that serve us well. We've been doing more and more, over the last few years, in C# and ASP.NET. Some web apps, some background services. In our C++ code base, we have a fair number of statically-linked libraries that contain code we share between projects. At this point, in our...
45
3020
by: =?Utf-8?B?QmV0aA==?= | last post by:
Hello. I'm trying to find another way to share an instance of an object with other classes. I started by passing the instance to the other class's constructor, like this: Friend Class clsData Private m_objSQLClient As clsSQLClient Private m_objUsers As clsUsers
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10319
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10147
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9947
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8971
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7496
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5380
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4046
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2877
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.