473,698 Members | 2,883 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sharing static data between projects

I have created an application that uses 3 parts: 1) a windows service
that distributes email 2) a form that configures the settings
(incoming address, outgoing address, etc) for that service and 3) a
form that acts as a report for how that service is doing (emails sent,
etc).

I want the report form (3) to be updated real time with the service's
progress. Right now I'm using the Singleton pattern for storing the
settings & data that the service uses (as it sends an email it updates
that iEmailsSent variable of that singleton. I read that static
variables are created once per namespace so I have renamed all the
projects to a single namespace so that they can share those static
variables. Now I figure that as the service performs its duties, I
should be able to see the results of those in real time via my report
form by just referencing that Singleton settings object, since that is
a static variable that should exist to all three of these projects
simultaniously.

However, when I test this (I have a windows form that does the same
thing as the service for debugging purposes) I open the service tester
form in debug mode and run it so that it sends a few email and updates
the Singleton variable, then while that's still open I open my report
which should be reading from that same static instance and it doesn't
see any of the info -- they're not "sharing".

Should this work and I just need to debug? Is the problem that I'm
running one in VS debug mode and one in native windows? Is there
something fundamentally wrong with the way I'm doing this? Is there
something I'm missing?

Thanks,
Noah

Mar 2 '07 #1
0 1087

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

Similar topics

1
1368
by: Jay W NOjwalkerSPAM | last post by:
I have some class objects each in separate projects that belong to a solution. The projects reference one another within that solution. The 'main' function calls the other procedure/function (different projects) that perform all the database work and manipulations to return a dataset to the instantiating code. This solution works without error. I am trying to build another solution that will use those same projects. The build is...
1
1946
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
3104
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...
16
2244
by: Robert W. | last post by:
I'm building a solution that has 1 component for the Desktop and 1 component for the Pocket PC. (Though this isn't a mobile question). I have a data library that will be shared on both platforms. So I've adopted the approach of having two projects share the same set of files. In my case, I have two similarly named projects: DataObjects DataObjectsCF The former is for the Desktop app and the latter is for the Compact Framework.
0
1120
by: Darren Oakey | last post by:
G'day - is there anyway of sharing the Session data across two different ASP.Net projects? Basically, I'm jumping from a page in one to a page in another, and I'd like to have the data flit across the divide!
3
2007
by: grooby | last post by:
I would like to develop an asp.net Web application using muliple web projects under one solution file and share the session information between web applications( or projects). Is this possible?
0
1558
by: rcolby | last post by:
Hi, A little advice on code sharing across projects, namespaces and dll's for references. I've got an application that is split between three different projects (one for a service, one for manual operation of the service and web client for the interface to the user). There are a lot of functions that are shared through these projects and I'm using the following format which is store in ApplicationNamspace.vb and doesn't seem to work...
4
1810
by: radiax | last post by:
Iam trying to find a simple solution for sharing data between windows applications( apart of using file system or remoting or MMF) . I tried using class library by making data members "shared" but it seems that data cant not be passed between applications. what am I doing wrong here? what are "simple" possible solutions? thanks
2
2277
by: David | last post by:
How do I share code across files in C#, without including a reference to a class library. Here's what I want to do. I have a device I want to talk to. It's a machine in a factory. It can talk on a serial port, or over ethernet. Either way it's talking, it sends the same data. So, I encapsulate the data structure in a class, and I stick the class in a .cs file. Now, I want to create three projects, and they all will deal with the...
0
8683
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
8610
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
9031
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
8873
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
7740
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
5862
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
4372
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
3052
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
2
2339
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.