From d422201e016f2836b8e226683e541c1d8270351c Mon Sep 17 00:00:00 2001 From: John Luo Date: Tue, 12 Jan 2016 00:47:18 -0800 Subject: [PATCH] Elaborating error message when no startup is specified --- src/Microsoft.AspNet.Hosting/Startup/StartupLoader.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.AspNet.Hosting/Startup/StartupLoader.cs b/src/Microsoft.AspNet.Hosting/Startup/StartupLoader.cs index 1898dd818a..c77cbced34 100644 --- a/src/Microsoft.AspNet.Hosting/Startup/StartupLoader.cs +++ b/src/Microsoft.AspNet.Hosting/Startup/StartupLoader.cs @@ -43,7 +43,10 @@ namespace Microsoft.AspNet.Hosting.Startup var environmentName = _hostingEnv.EnvironmentName; if (string.IsNullOrEmpty(startupAssemblyName)) { - throw new ArgumentException("Value cannot be null or empty.", nameof(startupAssemblyName)); + throw new ArgumentException( + string.Format("A startup method, startup type or startup assembly is required. If specifying an assembly, '{0}' cannot be null or empty.", + nameof(startupAssemblyName)), + nameof(startupAssemblyName)); } var assembly = Assembly.Load(new AssemblyName(startupAssemblyName));