Skip to content
This repository was archived by the owner on Dec 19, 2018. It is now read-only.

Commit

Permalink
Don't specify MainEntryPoint when compiling Razor assembly
Browse files Browse the repository at this point in the history
  • Loading branch information
pranavkm committed Jul 12, 2018
1 parent e7db3f8 commit 74667ed
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,21 @@ public async Task Build_WithP2P_WorksWhenBuildProjectReferencesIsDisabled()
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();
Expand Down

0 comments on commit 74667ed

Please sign in to comment.