Skip to content

Commit d6edf80

Browse files
committed
PR feedback.
1 parent 74060e3 commit d6edf80

File tree

2 files changed

+5
-32
lines changed

2 files changed

+5
-32
lines changed

docs/samples/Microsoft.ML.Samples/Microsoft.ML.Samples.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
<TargetFramework>netcoreapp2.1</TargetFramework>
55
<OutputType>Exe</OutputType>
66
<SignAssembly>false</SignAssembly>
7+
<!--This ensures that we can never make the mistake of adding this as a friend assembly. Please don't remove.-->
78
<PublicSign>false</PublicSign>
89
<RootNamespace>Samples</RootNamespace>
9-
<StartupObject>Microsoft.ML.Samples.Program</StartupObject>
10+
<StartupObject>Microsoft.ML.Samples.Program</StartupObject>
1011
</PropertyGroup>
1112

1213
<ItemGroup>
Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,15 @@
1-
using System;
2-
using System.Reflection;
3-
using Samples.Dynamic;
1+
using System.Reflection;
42

53
namespace Microsoft.ML.Samples
64
{
75
public static class Program
86
{
9-
public static void Main(string[] args)
10-
{
11-
CalculateFeatureContribution.Example();
12-
13-
if (args.Length > 0 && args[0] == "-runall")
14-
RunAll();
15-
}
7+
public static void Main(string[] args) => RunAll();
168

179
internal static void RunAll()
1810
{
1911
foreach (var type in Assembly.GetExecutingAssembly().GetTypes())
20-
{
21-
var method = type.GetMethod("Example", BindingFlags.NonPublic | BindingFlags.Public
22-
| BindingFlags.Static | BindingFlags.FlattenHierarchy);
23-
24-
if (method != null)
25-
{
26-
try
27-
{
28-
method.Invoke(null, null);
29-
}
30-
catch (Exception ex)
31-
{
32-
// Print the exception for debugging.
33-
Console.Write(type);
34-
Console.Write(ex);
35-
36-
// Throw to fail.
37-
throw ex;
38-
}
39-
}
40-
}
12+
type.GetMethod("Example", BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy)?.Invoke(null, null);
4113
}
4214
}
4315
}

0 commit comments

Comments
 (0)