473,594 Members | 2,770 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Charing Code with multiple projects

So I'm trying to Write a Backend to something and in testing I decided to
create a generic front end app that can simulate the passed in Data.

So I have 2 projects in my solution, though I'm finding that I've created
classes, structs, enums, constants that are going to be neede by both.

I don't want to have one project reference the other as they are not
'related' I want some 3rd project or something that I put all the stuff in.
Then I'm not sure what to put them in once they are in this 3rd Project.
CodeFile, Module, Class file, etc...

Okay, so this is a total noob Q, but I'm just used to the #INCLUDE and just
point to it and it all works. Seems like I cant define some things (i.e.
CONST) out of the Class scope, and I can only do that if its in a Module,
though the module does not seem to be seen by the other projects?

Okay, Maybe I need to go back to Pascal...

Thanks,
Scott<-=
Jun 27 '08 #1
10 1182
Scott,

Simple create a library project, this will result in a DLL that you can
reference from everywhere you want.

Cor

"Scott Townsend" <sc********@com munity.nospamsc hreef in bericht
news:ub******** ******@TK2MSFTN GP05.phx.gbl...
So I'm trying to Write a Backend to something and in testing I decided to
create a generic front end app that can simulate the passed in Data.

So I have 2 projects in my solution, though I'm finding that I've created
classes, structs, enums, constants that are going to be neede by both.

I don't want to have one project reference the other as they are not
'related' I want some 3rd project or something that I put all the stuff
in.
Then I'm not sure what to put them in once they are in this 3rd Project.
CodeFile, Module, Class file, etc...

Okay, so this is a total noob Q, but I'm just used to the #INCLUDE and
just point to it and it all works. Seems like I cant define some things
(i.e. CONST) out of the Class scope, and I can only do that if its in a
Module, though the module does not seem to be seen by the other projects?

Okay, Maybe I need to go back to Pascal...

Thanks,
Scott<-=

Jun 27 '08 #2
"Scott Townsend" <sc********@com munity.nospamsc hrieb
So I'm trying to Write a Backend to something and in testing I
decided to create a generic front end app that can simulate the
passed in Data.

So I have 2 projects in my solution, though I'm finding that I've
created classes, structs, enums, constants that are going to be
neede by both.

I don't want to have one project reference the other as they are not
'related' I want some 3rd project or something that I put all the
stuff in. Then I'm not sure what to put them in once they are in
this 3rd Project. CodeFile, Module, Class file, etc...

Okay, so this is a total noob Q, but I'm just used to the #INCLUDE
and just point to it and it all works. Seems like I cant define some
things (i.e. CONST) out of the Class scope, and I can only do that
if its in a Module, though the module does not seem to be seen by
the other projects?

Okay, Maybe I need to go back to Pascal...
It's common practice to put the reusable code into a DLL and reference
it from any project you want.
Armin

Jun 27 '08 #3
Sorry Cor, forgot mine in the outbox yesterday.
Armin
Jun 27 '08 #4
Armin,

As you do it, I know it is no echo.

:-)

Cor

"Armin Zingler" <az*******@free net.deschreef in bericht
news:eU******** ******@TK2MSFTN GP02.phx.gbl...
Sorry Cor, forgot mine in the outbox yesterday.
Armin
Jun 27 '08 #5
What about Constants? Seems like they only are available either in a Module
or in a Class, If I want to use them in multiple classes I can put them in a
Module for the Project, but when I put them in a Module for another project,
they cant bee seen?

Thanks,
"Cor Ligthert [MVP]" <no************ @planet.nlwrote in message
news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
Scott,

Simple create a library project, this will result in a DLL that you can
reference from everywhere you want.

Cor

"Scott Townsend" <sc********@com munity.nospamsc hreef in bericht
news:ub******** ******@TK2MSFTN GP05.phx.gbl...
>So I'm trying to Write a Backend to something and in testing I decided to
create a generic front end app that can simulate the passed in Data.

So I have 2 projects in my solution, though I'm finding that I've created
classes, structs, enums, constants that are going to be neede by both.

I don't want to have one project reference the other as they are not
'related' I want some 3rd project or something that I put all the stuff
in.
Then I'm not sure what to put them in once they are in this 3rd Project.
CodeFile, Module, Class file, etc...

Okay, so this is a total noob Q, but I'm just used to the #INCLUDE and
just point to it and it all works. Seems like I cant define some things
(i.e. CONST) out of the Class scope, and I can only do that if its in a
Module, though the module does not seem to be seen by the other projects?

Okay, Maybe I need to go back to Pascal...

Thanks,
Scott<-=


Jun 27 '08 #6

Scott,

Just try to forget constants while you are programming with OOP.

It is mostly a trashbin with all kind of constants which are never used. If
you really need them, then put them in a config.file.

Cor

"Scott Townsend" <sc********@com munity.nospamsc hreef in bericht
news:uX******** ******@TK2MSFTN GP04.phx.gbl...
What about Constants? Seems like they only are available either in a
Module or in a Class, If I want to use them in multiple classes I can put
them in a Module for the Project, but when I put them in a Module for
another project, they cant bee seen?

Thanks,
"Cor Ligthert [MVP]" <no************ @planet.nlwrote in message
news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
>Scott,

Simple create a library project, this will result in a DLL that you can
reference from everywhere you want.

Cor

"Scott Townsend" <sc********@com munity.nospamsc hreef in bericht
news:ub******* *******@TK2MSFT NGP05.phx.gbl.. .
>>So I'm trying to Write a Backend to something and in testing I decided
to create a generic front end app that can simulate the passed in Data.

So I have 2 projects in my solution, though I'm finding that I've
created classes, structs, enums, constants that are going to be neede by
both.

I don't want to have one project reference the other as they are not
'related' I want some 3rd project or something that I put all the stuff
in.
Then I'm not sure what to put them in once they are in this 3rd Project.
CodeFile, Module, Class file, etc...

Okay, so this is a total noob Q, but I'm just used to the #INCLUDE and
just point to it and it all works. Seems like I cant define some things
(i.e. CONST) out of the Class scope, and I can only do that if its in a
Module, though the module does not seem to be seen by the other
projects?

Okay, Maybe I need to go back to Pascal...

Thanks,
Scott<-=


Jun 27 '08 #7
What? You dont use Constants anymore??
So are you talking about the app.config?

How can I share those with Multiple Projects?

I'm developing a Client Server App that will share some common components
(Constants and Functions). I'd like to just have one file/Project with info
it it that both can share.

"Cor Ligthert[MVP]" <no************ @planet.nlwrote in message
news:3D******** *************** ***********@mic rosoft.com...
>
Scott,

Just try to forget constants while you are programming with OOP.

It is mostly a trashbin with all kind of constants which are never used.
If you really need them, then put them in a config.file.

Cor

"Scott Townsend" <sc********@com munity.nospamsc hreef in bericht
news:uX******** ******@TK2MSFTN GP04.phx.gbl...
>What about Constants? Seems like they only are available either in a
Module or in a Class, If I want to use them in multiple classes I can put
them in a Module for the Project, but when I put them in a Module for
another project, they cant bee seen?

Thanks,
"Cor Ligthert [MVP]" <no************ @planet.nlwrote in message
news:%2******* *********@TK2MS FTNGP02.phx.gbl ...
>>Scott,

Simple create a library project, this will result in a DLL that you can
reference from everywhere you want.

Cor

"Scott Townsend" <sc********@com munity.nospamsc hreef in bericht
news:ub****** ********@TK2MSF TNGP05.phx.gbl. ..
So I'm trying to Write a Backend to something and in testing I decided
to create a generic front end app that can simulate the passed in Data.

So I have 2 projects in my solution, though I'm finding that I've
created classes, structs, enums, constants that are going to be neede
by both.

I don't want to have one project reference the other as they are not
'related' I want some 3rd project or something that I put all the stuff
in.
Then I'm not sure what to put them in once they are in this 3rd
Project. CodeFile, Module, Class file, etc...

Okay, so this is a total noob Q, but I'm just used to the #INCLUDE and
just point to it and it all works. Seems like I cant define some things
(i.e. CONST) out of the Class scope, and I can only do that if its in a
Module, though the module does not seem to be seen by the other
projects?

Okay, Maybe I need to go back to Pascal...

Thanks,
Scott<-=


Jun 27 '08 #8
"Scott Townsend" <sc********@com munity.nospamsc hrieb
What about Constants? Seems like they only are available either in
a Module or in a Class, If I want to use them in multiple classes I
can put them in a Module for the Project, but when I put them in a
Module for another project, they cant bee seen?

What about an Enum? Can be outside a class.

Modules are rarely used because it's like putting all your files in the
root folder of your hard disc.
Armin

Jun 27 '08 #9
"Scott Townsend" <sc********@com munity.nospamsc hrieb:
What about Constants? Seems like they only are available either in a
Module or in a Class, If I want to use them in multiple classes I can put
them in a Module for the Project, but when I put them in a Module for
another project, they cant bee seen?
Make sure the access modifier is set to 'Public'. The default modifier is
'Friend'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Jun 27 '08 #10

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

Similar topics

3
2572
by: Harry Whitehouse | last post by:
I'm developing a small class which will be used in a number of distinct C# projects. This small class is undergoing constant change/refinement as I try to employ it in the different projects. I'm trying to maintain a *single* copy of the CS file that can be used in the multiple .NET projects. But I'm observing that when you add a CS file to a given .NET project, subsequent modifications to that file are only saved in the current...
2
5692
by: TaeHo Yoo | last post by:
Hi all, I have a solution which contains multiple projects. Those multiple projects should share the same session. For example, users login, create the session for users then these session information should be accessed by multiple projects. How do I archieve this? Any tutorial out there? Thanks
3
2128
by: Galore | last post by:
Hello! I'm trying to setup an ASP.NET multiple web projects application, following the article How To Create an ASP.NET Application from Multiple Projects for Team Development. I could do it without any trouble, but when I put this solution on Visual Source Safe, my nigthmare begins.... Always when I open this solution, VS.NET tries to open the web projects on different places (<original name> followed by "_1", "_2", ...). Has anyone got...
1
2076
by: Jody Gelowitz | last post by:
Within ASP.NET, is it possible to use a single .vb file and have it shared (or accessed) between multiple projects without having that file being copied to each project folder? ie. C:\Projects\MyProject1 (project 1) C:\Projects\MyProject2 (project 2) C:\Projects\CommonFiles\MyCommonFile.vb (common file directly accessed and compiled from Project1 and Project2)
2
6654
by: Samuel L Matzen | last post by:
Hi, I am trying to develop with multiple projects in a single solution. The many of these projects create .dlls that are used by other projects. When I reference a .dll I reference it in the bin directory of the project creating it. The problem I am having is that Visual Studio keeps throwing a whole bunch of error messages indicateing it can't overrite other version of dlls and that one object can't be converted to another object...
14
1561
by: ToddLMorgan | last post by:
Summary: How should multiple (related) projects be arranged (structured) and configured so that the following is possible: o Sharing common code (one of the projects would be a "common" project referenced by all others and likely the others would share at least the common project and possibly more as times goes on) o Clear separation of "production" code and "test" code (ie to readily ship source and test as separate components. Usually...
13
3330
by: Paul Cheetham | last post by:
Hi, I have two projects where I want to use the same source file in each project. If I add the file to each project, then a local copy is made. I want to be able to have a single source file used by both projects so that I only have to change one file. I am using compiler directives within the file, and so I can't just build it into a DLL and do it that way, I really do need to make both
9
14259
by: TC | last post by:
I need to design a system which represents multiple "projects" in SQL Server. Each project has the same data model, but is independent of all others. My inclination is to use one database to store all projects. Looking at the numbers involved, however, I wonder if I would get better performance by storing each project in its own database. Suppose I have 50 projects, each with two users and 10,000 rows; it seems to me I'd rather have 50 x...
2
1965
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...
0
7936
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7874
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
8366
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
6646
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...
0
5402
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3893
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2383
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
1
1469
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1203
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.