3 ** gmcs dumper.cs -r:System.dll -r:System.Web.dll -r:System.Web.Services.dll -r:System.Configuration.dll
5 ** 2. run it on windows:
6 ** > dumper.exe > dumper.out.microsoft
8 ** 3. transfer that file to linux and do:
9 ** $ dos2unix dumper.out.microsoft && sort dumper.out.microsoft > foo && mv foo dumper.out.microsoft
11 ** 4. run dumper on linux:
12 ** $ mono dumper.exe > dumper.out.linux && sort dumper.out.linux > foo && mv foo dumper.out.linux
14 ** 5. diff the results:
15 ** $ diff -u dumper.out.linux dumper.out.microsoft | grep ^[-+]
20 using System.Collections;
21 using System.Configuration;
23 using System.Reflection;
24 using System.Web.Configuration;
25 using System.Web.Services.Configuration;
29 new AnonymousIdentificationSection (),
30 new AssemblyCollection (),
31 new AssemblyInfo ("foo"),
32 new AuthenticationSection (),
33 new AuthorizationRuleCollection (),
34 new AuthorizationRule (AuthorizationRuleAction.Allow),
35 new AuthorizationSection (),
36 new BufferModesCollection (),
37 new BufferModeSettings ("name", 10, 10, 10, TimeSpan.FromMinutes (1), TimeSpan.FromMinutes(1), 10),
38 new BuildProviderCollection (),
39 new BuildProvider (".cs", "CSharpProvider"),
41 new ClientTargetCollection (),
42 new ClientTarget ("alias", "userAgent"),
43 new ClientTargetSection (),
44 new CodeSubDirectoriesCollection (),
45 new CodeSubDirectory ("dirname"),
46 new CompilationSection (),
47 new CompilerCollection (),
48 new Compiler ("options", "ext", "lang", "type", 1),
49 new CustomErrorCollection (),
50 new CustomError (404, "redirect"),
51 new CustomErrorsSection (),
52 new DeploymentSection (),
53 new EventMappingSettingsCollection (),
54 new EventMappingSettings ("name", "type"),
55 new ExpressionBuilderCollection (),
56 new ExpressionBuilder ("prefix", "type"),
57 new FormsAuthenticationConfiguration (),
58 new FormsAuthenticationCredentials (),
59 new FormsAuthenticationUserCollection (),
60 new FormsAuthenticationUser ("name", "password"),
61 new GlobalizationSection (),
62 new HealthMonitoringSection (),
63 new HostingEnvironmentSection (),
64 new HttpCookiesSection (),
65 new HttpHandlerActionCollection (),
66 new HttpHandlerAction ("path", "type", "verb"),
67 new HttpHandlersSection (),
68 new HttpModuleActionCollection (),
69 new HttpModuleAction ("name", "type"),
70 new HttpModulesSection (),
71 new HttpRuntimeSection (),
72 new IdentitySection (),
73 new MachineKeySection (),
74 new MembershipSection (),
75 new NamespaceCollection (),
76 new NamespaceInfo ("name"),
77 new OutputCacheProfileCollection (),
78 new OutputCacheProfile ("name"),
79 new OutputCacheSection (),
80 new OutputCacheSettingsSection (),
82 new PassportAuthentication (),
83 new ProcessModelSection (),
84 new ProfileGroupSettingsCollection (),
85 new ProfileGroupSettings ("name"),
86 new ProfilePropertySettingsCollection (),
87 new ProfilePropertySettings ("name"),
88 new ProfileSettingsCollection (),
89 new ProfileSettings ("name"),
90 new RoleManagerSection (),
91 new RootProfilePropertySettingsCollection (),
92 new RuleSettingsCollection (),
93 new RuleSettings ("name", "event", "provider", "profile", 1, 1, TimeSpan.FromMinutes (5), "custom"),
94 new SecurityPolicySection (),
95 new SessionPageStateSection (),
96 new SessionStateSection (),
97 new SqlCacheDependencyDatabaseCollection (),
98 new SqlCacheDependencyDatabase ("name", "connectionStringName"),
99 new SqlCacheDependencySection (),
100 new TagMapCollection (),
101 new TagMapInfo ("tagType", "mappedTag"),
102 new TagPrefixCollection (),
103 new TagPrefixInfo ("tagPrefix", "nameSpace", "assembly", "tagName", "source"),
105 new TransformerInfoCollection (),
106 new TransformerInfo ("name", "type"),
107 new TrustLevelCollection (),
108 new TrustLevel ("name", "policyFile"),
110 new UrlMappingCollection (),
111 new UrlMapping ("~/url", "~/mappedUrl"), /* UrlMapping uses a callback validator to validate the url(s) */
112 new UrlMappingsSection (),
113 new VirtualDirectoryMappingCollection (),
114 // new VirtualDirectoryMapping ("\\phys\\dir", true), /* PhysicalDirectory seems to validate its input without using a Validator (decorator, anyway..)*/
115 new WebControlsSection (),
116 new WebPartsPersonalizationAuthorization (),
117 new WebPartsPersonalization (),
118 new WebPartsSection (),
119 new XhtmlConformanceSection (),
121 /* System.Configuration stuff */
122 new AppSettingsSection (),
123 new IgnoreSection (),
124 new ConnectionStringSettings (),
125 new ConnectionStringSettingsCollection (),
126 new ProtectedProviderSettings (),
128 /* System.Web.Services stuff */
129 new DiagnosticsElement (),
130 new ProtocolElementCollection (),
131 new ProtocolElement (),
132 new SoapEnvelopeProcessingElement (),
133 new SoapExtensionTypeElementCollection (),
134 new SoapExtensionTypeElement (),
135 new TypeElementCollection (),
137 new WebServicesSection (),
138 new WsdlHelpGeneratorElement (),
139 new WsiProfilesElementCollection (),
140 new WsiProfilesElement (),
142 /* System.Net stuff */
143 //new AuthenticationModuleElement (),
144 //new AuthenticationModuleElementCollection (),
145 //new AuthenticationModulesSection (),
146 //new BypassElement (),
147 //new BypassElementCollection (),
148 //new ConnectionManagementElement (),
149 //new ConnectionManagementElementCollection (),
150 //new ConnectionManagementSection (),
151 //new DefaultProxySection (),
152 //new HttpCachePolicyElement (),
153 //new Ipv6Element (),
154 //new ModuleElement (),
155 //new ModuleElementCollection (),
162 public void DumpProperties ()
164 foreach (object o in things) {
165 Type type = o.GetType ();
166 PropertyInfo pinfo = type.GetProperty ("Properties", BindingFlags.Instance | BindingFlags.NonPublic);
171 ConfigurationPropertyCollection col = (ConfigurationPropertyCollection)pinfo.GetValue (o, null);
172 foreach (ConfigurationProperty p in col) {
173 Console.WriteLine ("{0}.{1} (Type) = {2}", type, p.Name, p.Type);
174 if (p.Validator != null && p.Validator.GetType () != typeof (DefaultValidator))
175 Console.WriteLine ("{0}.{1} (Validator) = {2} ", type, p.Name, p.Validator);
180 public void DumpConverters ()
182 foreach (object o in things) {
183 Type type = o.GetType ();
184 PropertyInfo pinfo = type.GetProperty ("Properties", BindingFlags.Instance | BindingFlags.NonPublic);
189 ConfigurationPropertyCollection col = (ConfigurationPropertyCollection)pinfo.GetValue (o, null);
190 foreach (ConfigurationProperty p in col) {
191 if (p.Converter != null)
192 Console.WriteLine ("{0}.{1} (Converter) = {2} ", type, p.Name, p.Converter);
197 public void DumpElementProperties ()
199 foreach (object o in things) {
200 Type type = o.GetType ();
201 PropertyInfo pinfo = type.GetProperty ("ElementProperty", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
206 ConfigurationElementProperty p = (ConfigurationElementProperty)pinfo.GetValue (o, null);
208 Console.WriteLine ("{0}.ElementProperty = null", type);
209 else if (p.Validator == null)
210 Console.WriteLine ("{0}.ElementProperty (Validator) = null", type);
212 Console.WriteLine ("{0}.ElementProperty (Validator) = {1} ({2})", type, p.Validator, p.Validator.CanValidate (type));
216 public void DumpRuntimeObjects ()
218 foreach (object o in things) {
219 Type type = o.GetType ();
220 MethodInfo minfo = type.GetMethod ("GetRuntimeObject", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
225 object ro = minfo.Invoke (o, null);
228 Console.WriteLine ("{0}.GetRuntimeObject() = null", type);
230 Console.WriteLine ("{0}.GetRuntimeObject() = {1} ({2})", type, ro.GetType(), ro == o);
231 if (ro.GetType() == typeof (Hashtable)) {
232 foreach (object key in ((Hashtable)ro).Keys)
233 Console.WriteLine (" hash[{0}] = {1}", key, ((Hashtable)ro)[key]);
238 public static void Main (string[] args) {
239 Dumper d = new Dumper ();
244 d.DumpElementProperties ();
245 d.DumpRuntimeObjects ();
247 catch (Exception e) {
248 Console.WriteLine (e);