Skip to content

Commit c2b4c84

Browse files
JamesNKmitchdenny
authored andcommitted
Fix gRPC?
1 parent d347727 commit c2b4c84

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/ProjectTemplates/test/Templates.Tests/GrpcTemplateTest.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,18 @@ private async Task GrpcTemplateCore(string[] args = null)
7676

7777
await project.RunDotNetNewAsync("grpc", args: args);
7878

79+
var nativeAot = args?.Contains(ArgConstants.PublishNativeAot) ?? false;
7980
var expectedLaunchProfileNames = new[] { "http", "https" };
8081
await project.VerifyLaunchSettings(expectedLaunchProfileNames);
8182

8283
await project.VerifyHasProperty("InvariantGlobalization", "true");
8384

84-
await project.RunDotNetPublishAsync();
85+
// Force a restore if native AOT so that RID-specific assets are restored
86+
await project.RunDotNetPublishAsync(noRestore: !nativeAot);
87+
88+
// Run dotnet build after publish. The reason is that one uses Config = Debug and the other uses Config = Release
89+
// The output from publish will go into bin/Release/netcoreappX.Y/publish and won't be affected by calling build
90+
// later, while the opposite is not true.
8591

8692
await project.RunDotNetBuildAsync();
8793

0 commit comments

Comments
 (0)