. Net remoting Exception Handling: intercepts exceptions thrown by the server from the client

Source: Internet
Author: User

Currently, a project in charge is in the testing stage. This project is developed using. NET 2.0 and implemented using. Net remoting Technology in internal communication. However, a problem was found during the test:

The client cannot intercept the exception content thrown on the server. It can only receive "server encountered an internal error. for more information, turn off customerrors in the server's. config file. "error message.

Depressed! Since the error message indicates the solution, do it. Add a configuration file on the server according to the method provided by msdn and add the following content:

<System. runtime. remoting>

<Customerrors mode = "off"/>

</System. runtime. remoting>

Run one, but it still doesn't work! Fortunately, we have the Internet. Search for it, hey. The following is a solution found on the Internet (verification is feasible ):

Add two statements after remotingconfiguration. registerwellknownservicetype (...) on the server

Remotingconfiguration. customerrorsmode = customerrorsmodes. off;
Remotingconfiguration. customerrorsenabled (false );

Although the solution to this problem is simple, there is not much original content in this article, but it seems that many of my friends have encountered this problem from the results of online search, and it is not solved in the end. Therefore, I am afraid to put it on the homepage to help more siblings.

The solution for this article comes from: http://blog.csdn.net/oneiter/archive/2007/05/19/1616369.aspx

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.