Re: Windows Service config file

Tech-Archive recommends: Speed Up your PC by fixing your registry



RemotingConfiguration.CustomErrorsMode = CustomErrorsModes.Off;
or
RemotingConfiguration.Configure("ReportsServer.exe.config");

does not make any difference.
the client still is getting
"Server encountered an internal error. For more information, turn off
customErrors in the server's .config file."


I have tried to compile in Debug and Release and it did not make any
difference.

I know for a fact that the lines below get executed because I set the port
number in the same method.

RemotingConfiguration.CustomErrorsMode = CustomErrorsModes.Off;
or
RemotingConfiguration.Configure("ReportsServer.exe.config");


"Steven Cheng [MSFT]" <stcheng@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:EKyhrUPpIHA.4284@xxxxxxxxxxxxxxxxxxxxxxxxx
Hi Peter,

Based on the code snippet you provided, you have used the following code
to set the CustomErrorMode on server:

RemotingConfiguration.CustomErrorsMode = CustomErrorsModes.Off;

Didn't it work?

Based on my understanding, there are two means to set Custom Error mode
for
remoting service:

1. Programmatically set it via code, just like the code you provided, you
can set RemotingConfiguration.CustomErrorsMode at initialization time.

2. You can also use configuration file to set the custom error mode. e.g.

==========
<system.runtime.remoting>
<customErrors mode="Off" />
..
==========

However, you need to make sure you've called the following method so as to
tell the remoting runtime to load configuration from the app.config file:

=============
static void Init()
{
Console.WriteLine("Init...........................");

//here SimpleRemotingSln.ServerApp.exe is my server appliation's exe file
name.


RemotingConfiguration.Configure("SimpleRemotingSln.ServerApp.exe.config");
........
============

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@xxxxxxxxxxxxxx

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.

--------------------
From: "Peter" <czupet@xxxxxxxxxxxxx>
References: <OoiI1lIpIHA.2188@xxxxxxxxxxxxxxxxxxxx>
<003eda0c-26fb-48f9-91c5-24dfc359d2a3@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
<#0h#1pLpIHA.4760@xxxxxxxxxxxxxxxxxxxx>
<OyjZyRMpIHA.672@xxxxxxxxxxxxxxxxxxxx>
<O75p$DNpIHA.4672@xxxxxxxxxxxxxxxxxxxx>
<uhbX6TNpIHA.2068@xxxxxxxxxxxxxxxxxxxx>
Subject: Re: Windows Service config file
Date: Tue, 22 Apr 2008 21:12:36 -0500

Here's the error message on the client sided

"Server encountered an internal error. For more information, turn off
customErrors in the server's .config file."

Here's the conde on the Server side.

namespace ReportsService
{
public partial class ReportService : ServiceBase
{
private TcpChannel _objChannel = null;

private const int INT_DEFAULT_PORT = 8000;
private const string STR_DEFAULT_NAME = "ReportsServer.tcp";

public ReportService()
{
InitializeComponent();
}

protected override void OnStart(string[] args)
{
RemotingConfiguration.CustomErrorsMode =
CustomErrorsModes.Off;
// Create the TcpChannel
this._objChannel = new TcpChannel(INT_DEFAULT_PORT);
ChannelServices.RegisterChannel(this._objChannel, false);

// Register the Proxy class for remoting.
RemotingConfiguration.RegisterWellKnownServiceType(
typeof(Report),
STR_DEFAULT_NAME,
WellKnownObjectMode.Singleton);

}

protected override void OnStop()
{
ChannelServices.UnregisterChannel(this._objChannel);
}
}
}

"Willy Denoyette [MVP]" <willy.denoyette@xxxxxxxxxx> wrote in message
news:uhbX6TNpIHA.2068@xxxxxxxxxxxxxxxxxxxxxxx
"Peter" <czupet@xxxxxxxxxxxxx> wrote in message
news:O75p$DNpIHA.4672@xxxxxxxxxxxxxxxxxxxxxxx
I am using a Windows service with remoting

and I have tried both app.config file - where app = applicationname.exe
and I have tried RemotingConfiguration.CustomErrorsEnabled on the
client
side and still getting the same error on the client.

My application name is ReportsService.exe
and the config file is ReportsService.exe.config



But this doesn't answer the question whether you are using a Config file
or whether you are explicitly configuring the services and channels in
code. I would love to see the code that initializes the server side of
your remoting service.
Also, what's the exact error message received by the client when _the_
error occurs?


Willy.







.



Relevant Pages

  • openvpn for windows server
    ... -My requirement is client should have 192.168.10.0/24 ipaddress and it ... I am able to connect client to server, but i am not able to ping any ... I am attachting the server config and client config file, ... # clients or if a connecting client has a private ...
    (comp.os.linux.networking)
  • fc5 + openvpn + not routing across the tunnel..
    ... I have configured openvpn in my lab ... bad source address from client, ... the server is configured as follows ... # This config item must be copied to ...
    (Fedora)
  • Re: Slow opening of files
    ... will post the IP config tomorrow when I can access a workstation, ... if they open the file via the Office App itself the file opens ... The client has a member server and the same ...
    (microsoft.public.windows.server.sbs)
  • Re: Offline Files and RDC (Multiple)
    ... Create a computer account on the customers SBS server. ... Well that worked fine on my system - which I'd setup exactly how the clients ... Also its not at all clear whether the message is talkin about the "Client" ... do I remove whatever has got setup to config "multiple remote desktop ...
    (microsoft.public.windows.server.sbs)
  • Re: Offline Files and RDC (Multiple)
    ... tablet PC) and, yes, its from the client side that I've been trying to make ... server or client side please? ... side systems is a config area for Terminal Connections that configures the ...
    (microsoft.public.windows.server.sbs)