keyongtech


  keyongtech > dotnet.framework.* > dotnet.framework.remoting > 02/2006

 #1  
02-24-06, 02:28 PM
Michael Blevins
First let me explain my architecture. I have an ASP.Net (VB.Net)
application that is the client, a VB.Net Windows Service that is the
remote server for the VB.Net class library remote object. In the
client application I have a web.config file that contains a connection
string in the appSettings element. I don't want to pass the connection
over the wire, so I created an app.config for the class library remote
object and added the same connection entry within the appSettings
element and it contains the following (Where XXX are appropriate
values).

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="connectionString" value="Application
Name=XXX;Server=XXX;Database=XXX;UID=XXX;PWD=XXX" />
</appSettings>
</configuration>

The issue is that I'm unable to access the appSettings in the
app.config file. I have read several posts and I have the config file
named "app.config" and it contains the following (Where XXX are
appropriate values):

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="connectionString" value="Application
Name=XXX;Server=XXX;Database=XXX;UID=XXX;PWD=XXX" />
</appSettings>
</configuration>

Now both the client app and the remote object have references to
DataAccess and BusinessEntity objects. Inside the DataAccess object
there is a property that returns the connection as follows (Where
Private Shared _defaultConnectionName As String = "connectionString"):

Protected Shared ReadOnly Property DefaultConnectionString() As String
Get
Return
ConfigurationSettings.AppSettings.Get(_defaultConn ectionName)
End Get
End Property

This code works fine in the ASP.Net client application and has been
working for a long time. I have just added the remoting object to my
project. When I try to get this property it returns Nothing. Any
pointers???

Thank for responses in advance!
 #2  
02-27-06, 07:21 PM
Zoe Hart
Michael,

I posted a question related to yours recently under the subject
"System.Configuration classes in a remote object" so this is really the
blind leading the blind, but I'm hoping to do something very much like what
you're doing. I was assuming however that the remote object would get its
configuration settings not from its own configuration file but from the
configuration of the Windows Service application in which it's hosted. If
you create an app.config file in the Windows Service project, it should
generate service.exe.config (based on your service name) when you build the
service. This is consistent with how class libraries generally get their
configuration context, from the calling application.

Mind you, I have no idea if I'm right. This is just how I thought it would
work. Since what you're trying doesn't work, maybe you could try my approach
and let me know if it works.

Zoe

"Michael Blevins" <mike.blevins> wrote in message
news:8570
[..]
 #3  
02-28-06, 05:52 PM
Michael Blevins
Zoe,

I actually changed my approach from TCP channel to the HTTP channel on
my remote object, effectively removing the Windows service. The remote
object uses its own web.config file when hosted in IIS, so my issue is
resolved... But using binary over http, I have read, is slower than
using the tcp channel. I just need to get this going because of
timeline issues and I haven't received any response in this newsgroup.
Good luck, and I hope you are able to get your application working.

Thanks,
Michael Blevins
Similar Threads
How do client and server access same instance of a remote object?

Hi all, I have a remote object, a client application and a remote host application. I can access remote object from client but I want host application to use same instance...

Remote client is using local object instead of remote object

This is my fist time using .NET remoting, so I started out by trying an example from this site: [..] It is a basic client - server example, but it does not seem to be...

Calling Remote Object Inside the windows Service

Hi, I'm developing a Windows Service to host a Singleton RemoteObject(Say MyRemoteObject). In the OnStart() Method of the Windows Service I'm reading the Config File to...

pass server side parameter to client-activated remote object

I would like to use a server side db connection object in a client-activated remote object. Any Ideas how to do that ? Thank you for your time. Regards Max

Playing Music on Remote Server from Client Remote Desktop Session?

I'm having a heck of a time trying to find a way to listen to the media play on the remote server using remote desktop. All sounds error out and defualt driver is the RDP...


All times are GMT. The time now is 08:55 PM. | Privacy Policy