16
16
17
17
using System ;
18
18
using System . Collections ;
19
+ using System . Configuration ;
19
20
using System . Diagnostics ;
21
+ using System . Reflection ;
20
22
using System . Runtime . Remoting ;
21
23
using System . Runtime . Remoting . Channels ;
22
24
using System . Runtime . Remoting . Channels . Ipc ;
@@ -32,6 +34,11 @@ class RemoteType : MarshalByRefObject
32
34
{
33
35
}
34
36
37
+ static void SetAllowTransparentProxy ( bool allow )
38
+ {
39
+ ConfigurationManager . AppSettings . Set ( "microsoft:Remoting:AllowTransparentProxyMessage" , allow . ToString ( ) ) ;
40
+ }
41
+
35
42
static void Main ( string [ ] args )
36
43
{
37
44
try
@@ -43,6 +50,7 @@ static void Main(string[] args)
43
50
TypeFilterLevel typefilter = TypeFilterLevel . Low ;
44
51
CustomErrorsModes custom_errors = CustomErrorsModes . Off ;
45
52
string name = "RemotingServer" ;
53
+ bool disable_transparent_proxy_fix = false ;
46
54
47
55
OptionSet p = new OptionSet ( ) {
48
56
{ "s|secure" , "Enable secure mode" , v => secure = v != null } ,
@@ -53,6 +61,7 @@ static void Main(string[] args)
53
61
{ "e|error=" , "Set custom error mode (On, Off, RemoteOnly) (don't show full errors in remote calls)" ,
54
62
v => custom_errors = ( CustomErrorsModes ) Enum . Parse ( typeof ( CustomErrorsModes ) , v , true ) } ,
55
63
{ "n|name=" , "Set the remoting class name" , v => name = v } ,
64
+ { "d" , "Disable the 'AllowTransparentProxyMessage' setting fix." , v => disable_transparent_proxy_fix = v != null } ,
56
65
{ "h|?|help" , v => showhelp = v != null } ,
57
66
} ;
58
67
@@ -66,6 +75,7 @@ static void Main(string[] args)
66
75
}
67
76
else
68
77
{
78
+ SetAllowTransparentProxy ( ! disable_transparent_proxy_fix ) ;
69
79
RemotingConfiguration . CustomErrorsMode = custom_errors ;
70
80
71
81
Trace . Listeners . Add ( new ConsoleTraceListener ( true ) ) ;
0 commit comments