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