Hi all,
I'm creating a class factory and a bunch of adapters to allow in house applications to communicate with mobile applications over different cellular networks.
I've got my class factory and interface definition [IMobileAdapter] in a single assembly. The class factory will instantiate the correct adapter for communication with a mobile device at runtime. We're doing it this way because we won't know which cellular network we're communicating over until the user specifies the device.
Each adapter will have its own assembly which will contain an implementation of the IMobileAdapter interface specific to the cellular network over which it communicates.
This bit was a piece of cake, I've already created the class factory code and it instantiates the adapters like a charm.
At least one of these adapters uses a service reference (web reference for those still in 2.0 land). When you create the service reference it puts a bunch of stuff in the config file upon which it depends to instantiate the service calls.
So now I get to instantiate an adapter through my class factory in my application [a third assembly].
It is here that I'm running into an issue: It appears that the creation of the service reference is failing because the configuration appears in the app.config for the adapter assembly (which is where it needs to be). When I move the configuration from the adapter assembly into the app.config file in my main application, everything works like a charm.
The issue with this is that the service configuration is not relevant to the main application, and developers using the adapter shouldn't need to know anything about it other than the method calls and return values, including the configuration of said adapter.
Onto my question: Has anyone else had to instantiate service references [or indeed other configuration dependent code] in sub assemblies and how did they [if indeed they did] get their objects to look within its own app.config instead of that of the main application?
I've come across some articles on "per assembly configuration", but it requires writing your own custom code to look at the defined configuration file - this is a simple concept which I could do easily if I was referencing the configuration file from my code. However, because this is a service reference it's more complex in that I haven't found a way to repoint the service reference to a different configuration file.
TIA
Ben
0 1391 Sign in to post your reply or Sign up for a free account.
Similar topics |
by: TT (Tom Tempelaere) |
last post by:
Hi there
The following is a description to reproduce the problem. I do not know if this is a bug in the .NET environment/framework (I suspect it is), or if there is something that I am doing wrong. But I am definitely stuck on this one. I cannot find a solution
Make a new C# service project, and add an installer for the service (using menu). Set properties for a test scenario, don't modify code. Run InstallUtil, everything installs fine....
|
by: Ollie Riches |
last post by:
I am trying to dynamically load an assembly that has a reference to
'Interop.WMEncoderLib.dll' which is a PIA to the windows media player DRM
components. When I run the code from a console application it works
perfectly fine, but when the assembly containing the reference is load from
a windows service an exception is thrown with the following message:
"File or assembly name Interop.WMEncoderLib, or one of its dependencies, was
not...
|
by: Shailesh Humbad |
last post by:
I figured out what was causing the "Access is Denied" error when
calling functions from referenced DLLs in my service. I've tried to
be very detailed, so bear with me.
It turns out that libraries I made myself were not having this
problem, but it only happened with a zip library I downloaded and
copied into my program's directory. When using classes from this
library, my service threw an "Access Is Denied" FileLoadException,
which...
|
by: Noel |
last post by:
Hello,
I'm currently developing a web service that retrieves data from an employee
table. I would like to send and retrieve a custom employee class to/from the
webservice. I have currently coded the custom employee class and have built
it as a separate library (employee.dll). This employee.dll is being
referenced by both the web service and the windows application.
I face the following problem when I send this class to the webservice.
|
by: stic |
last post by:
Hi,
After a few hours of asp. net configuration, ACL, web service specifications
digging and of course extensive googling, I finally came to you… and as
usually I need help…
I need to add specific dll files as reference to my WS. At this project for
some reason we use ‘copy local = false’. And that is what makes a lot
of problems with WS references.
| |
by: Olivier BESSON |
last post by:
Hello,
I have a web service of my own on a server (vb.net). I must declare it with
SoapRpcMethod to be used with JAVA.
This is a simple exemple method of my vb source :
>************************************************************************
> <WebMethod(), System.Web.Services.Protocols.SoapRpcMethod()> _
> Public Function HelloWorld() As
> <System.Xml.Serialization.SoapElementAttribute("return")> String
|
by: =?Utf-8?B?Q3JhaWc=?= |
last post by:
Background:
I am building a Windows enterprise application that has separate assemblies
for UI, business logic/rules, and data access (i.e. typical N-tier
architecture). Many of the assemblies reference a "name and address web
service," which gives me validation lists for name honorifics (e.g. Dr, Mr,
Miss, Mrs), name suffixes (e.g. Sr, Jr, III), and City/State/ZIP combos. The
same name and address web service also can save and retrieve...
|
by: =?Utf-8?B?U2ltb25EZXY=?= |
last post by:
Hi All
I would like to install the same Windows Service project on the same server
under different names, one for each customer. I have been able to do it but
I would like an expert opinion as to whether my solution is robust or whether
there is a better way to do it.
What I've been trying to do is to create a core project with different
extension projects, one for each customer. I wanted to create a different
Setup project for each...
|
by: =?Utf-8?B?cmtibmFpcg==?= |
last post by:
I was executing the steps given in http://suppor.microsoft.com/kb/308359 for
testing a sample web service application. However, the following line gives a
compilation error:
localhost.Service1 xxx = new localhost.Service1();
localhost is not recognized by the compiler.
|
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...
|
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,...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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...
|
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();...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |