Elaborating error message when no startup is specified

This commit is contained in:
John Luo 2016-01-12 00:47:18 -08:00
parent 317c9d0e80
commit d422201e01
1 changed files with 4 additions and 1 deletions

View File

@ -43,7 +43,10 @@ namespace Microsoft.AspNet.Hosting.Startup
var environmentName = _hostingEnv.EnvironmentName; var environmentName = _hostingEnv.EnvironmentName;
if (string.IsNullOrEmpty(startupAssemblyName)) 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)); var assembly = Assembly.Load(new AssemblyName(startupAssemblyName));