Don't specify MainEntryPoint when compiling Razor assembly

This commit is contained in:
Pranav K 2018-06-19 11:01:39 -07:00
parent e7db3f840b
commit 74667eda9c
No known key found for this signature in database
GPG Key ID: 1963DA6D96C3057A
2 changed files with 16 additions and 1 deletions

View File

@ -42,6 +42,7 @@ Copyright (c) .NET Foundation. All rights reserved.
Remove @(DocFileItem)
Remove PdbFile="$(PdbFile)"
Remove OutputRefAssembly="@(IntermediateRefAssembly)"
Remove MainEntryPoint="$(StartupObject)"
Remove EmbedAllSources="$(EmbedAllSources)" - not supported by our supported version of MSBuild
@ -133,7 +134,6 @@ Copyright (c) .NET Foundation. All rights reserved.
KeyFile="$(KeyOriginatorFile)"
LangVersion="$(LangVersion)"
LinkResources="@(LinkResource)"
MainEntryPoint="$(StartupObject)"
ModuleAssemblyName="$(ModuleAssemblyName)"
NoConfig="true"
NoLogo="$(NoLogo)"

View File

@ -553,6 +553,21 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
Assert.BuildPassed(result);
}
[Fact]
[InitializeTestProject("SimpleMvc")]
public async Task Build_WithStartupObjectSpecified_Works()
{
var result = await DotnetMSBuild("Build", $"/p:StartupObject=SimpleMvc.Program");
Assert.BuildPassed(result);
Assert.FileExists(result, IntermediateOutputPath, "SimpleMvc.Views.dll");
Assert.FileExists(result, IntermediateOutputPath, "SimpleMvc.Views.pdb");
Assert.FileExists(result, IntermediateOutputPath, "SimpleMvc.Views.dll");
Assert.FileExists(result, IntermediateOutputPath, "SimpleMvc.Views.pdb");
}
private static DependencyContext ReadDependencyContext(string depsFilePath)
{
var reader = new DependencyContextJsonReader();