From 18595e221e0fbd4f143e9259634c05e5014511bc Mon Sep 17 00:00:00 2001 From: David Fowler Date: Thu, 22 Oct 2015 04:34:01 -0700 Subject: [PATCH] Make publish require and entrypoint --- src/Microsoft.DotNet.Tools.Publish/Program.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Microsoft.DotNet.Tools.Publish/Program.cs b/src/Microsoft.DotNet.Tools.Publish/Program.cs index 8c0d49986..ad3ed6c20 100644 --- a/src/Microsoft.DotNet.Tools.Publish/Program.cs +++ b/src/Microsoft.DotNet.Tools.Publish/Program.cs @@ -81,6 +81,14 @@ namespace Microsoft.DotNet.Tools.Publish { Reporter.Output.WriteLine($"Publishing {context.RootProject.Identity.Name.Yellow()} for {context.TargetFramework.DotNetFrameworkName.Yellow()}/{context.RuntimeIdentifier}"); + var options = context.ProjectFile.GetCompilerOptions(context.TargetFramework, configuration); + + if (!options.EmitEntryPoint.GetValueOrDefault()) + { + Reporter.Output.WriteLine($"{context.RootProject.Identity} does not have an entry point defined.".Red()); + return 1; + } + // Generate the output path if (string.IsNullOrEmpty(outputPath)) {