开发者

How to use App.config in .NET3.5 when using Remoting with out adding Remoting related configuation in App.config?

I am trying to use an App.config for a Windows Service application which is hosting Remoting and is developed in .NET3.5. In that App.config, I would like to keep some values which I will be using across the solution. I am not adding Remoting relation configuration stuff to it. But while running application it is expec开发者_如何学运维ting Remoting related configuration stuff in App.config. I dont want to put Remoting related configuration in that file. How I can resolve this issue?


You can configure remoting programmatically,

to register a channel you can

IChannel tcpChannel = new TcpChannel(8888);
ChannelService.RegisterChannel(tcpChannel);

Basicly everything can be configured in code.

I would recommend Ingo Rammer's Advanced .Net Remoting!


You could put your remoting configuration stuff in a separate file, then configure remoting by calling:

System.Runtime.Remoting.RemotingConfiguration.Configuration(myConfigFileName, true);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜