Skip to content

Commit 007a063

Browse files
committed
Fix gRPC?
1 parent da62e9c commit 007a063

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
@@ -72,12 +72,18 @@ private async Task GrpcTemplateCore(string[] args = null)
7272

7373
await project.RunDotNetNewAsync("grpc", args: args);
7474

75+
var nativeAot = args?.Contains(ArgConstants.PublishNativeAot) ?? false;
7576
var expectedLaunchProfileNames = new[] { "http", "https" };
7677
await project.VerifyLaunchSettings(expectedLaunchProfileNames);
7778

7879
await project.VerifyHasProperty("InvariantGlobalization", "true");
7980

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

8288
await project.RunDotNetBuildAsync();
8389

0 commit comments

Comments
 (0)