Robert Hurlbut Blog

Thoughts on Software Security, Software Architecture, Software Development, and Agility

ASP.NET and RemotingConfiguration.Configure()

Saturday, May 22, 2004 Comments

 .NET   .NET Remoting   ArchitecturePatterns   ASP.NET 
Share:   Share on LinkedIn    Share on Twitter    Share on Facebook   

Ingo mentions a solution I found this week for setting up ASP.NET as a .Net Remoting client (it is actually a bug fix):

If you use ASP.NET as a Remoting client, you should not use this code in your app.config:

protected void Application_Start(Object sender, EventArgs e)
                {
                RemotingConfiguration.Configure(Server.MapPath("client.exe.config"));
                }
                

Using Server.MapPath(), some requests might fail if the application is recycled and the first request is not for a file in the application's root directory but in a subdirectory (i.e. "http://yourhost/somedir/default.aspx" instead of "http://yourhost/default.aspx". Robert suggested to use the following (and of course, he's totally right):

protected void Application_Start(Object sender, EventArgs e)
                {
                RemotingConfiguration.Configure(Request.PhysicalApplicationPath 
        + "client.exe.config");
                }
Share:   Share on LinkedIn    Share on Twitter    Share on Facebook