Skip to content

Commit 2fd9e40

Browse files
author
John Luo
committed
Merge branch 'release/3.0-preview3'
2 parents 6a06bf8 + 26006e5 commit 2fd9e40

File tree

20 files changed

+405
-5
lines changed

20 files changed

+405
-5
lines changed

eng/Versions.props

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,13 @@
174174
<BenchmarkDotNetPackageVersion>0.10.13</BenchmarkDotNetPackageVersion>
175175
<CastleCorePackageVersion>4.2.1</CastleCorePackageVersion>
176176
<FSharpCorePackageVersion>4.2.1</FSharpCorePackageVersion>
177+
<GoogleProtobufPackageVersion>3.6.1</GoogleProtobufPackageVersion>
178+
<GrpcAspNetCoreServerPackageVersion>0.1.19-pre1</GrpcAspNetCoreServerPackageVersion>
179+
<GrpcCorePackageVersion>1.19.0-pre1</GrpcCorePackageVersion>
180+
<GrpcToolsPackageVersion>1.19.0-pre1</GrpcToolsPackageVersion>
177181
<IdentityServer4AspNetIdentityPackageVersion>2.3.0</IdentityServer4AspNetIdentityPackageVersion>
178182
<IdentityServer4EntityFrameworkPackageVersion>2.3.0</IdentityServer4EntityFrameworkPackageVersion>
179183
<IdentityServer4PackageVersion>2.3.0</IdentityServer4PackageVersion>
180-
<GoogleProtobufPackageVersion>3.1.0</GoogleProtobufPackageVersion>
181184
<MessagePackPackageVersion>1.7.3.4</MessagePackPackageVersion>
182185
<MoqPackageVersion>4.10.0</MoqPackageVersion>
183186
<MonoCecilPackageVersion>0.10.1</MonoCecilPackageVersion>

eng/scripts/CodeCheck.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ try {
8888

8989
Get-ChildItem "$repoRoot/*.sln" -Recurse `
9090
| ? {
91-
# This .sln file is used by the templating engine.
92-
$_.Name -ne "RazorComponentsWeb-CSharp.sln"
91+
# These .sln files are used by the templating engine.
92+
($_.Name -ne "RazorComponentsWeb-CSharp.sln") -and ($_.Name -ne "GrpcService-CSharp.sln")
9393
} `
9494
| % {
9595
Write-Host " Checking $(Split-Path -Leaf $_)"

src/Components/Blazor/Templates/src/content/BlazorHosted-CSharp/BlazorHosted-CSharp.Client/Shared/SurveyPrompt.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<span class="text-nowrap">
66
Please take our
7-
<a target="_blank" class="font-weight-bold" href="https://go.microsoft.com/fwlink/?linkid=2069004">brief survey</a>
7+
<a target="_blank" class="font-weight-bold" href="https://go.microsoft.com/fwlink/?linkid=2077509">brief survey</a>
88
</span>
99
and tell us what you think.
1010
</div>

src/Components/Blazor/Templates/src/content/BlazorStandalone-CSharp/Shared/SurveyPrompt.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<span class="text-nowrap">
66
Please take our
7-
<a target="_blank" class="font-weight-bold" href="https://go.microsoft.com/fwlink/?linkid=2069004">brief survey</a>
7+
<a target="_blank" class="font-weight-bold" href="https://go.microsoft.com/fwlink/?linkid=2077509">brief survey</a>
88
</span>
99
and tell us what you think.
1010
</div>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>netcoreapp3.0</TargetFramework>
6+
<LangVersion>7.1</LangVersion>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<Protobuf Include="..\Protos\*.proto" GrpcServices="Client" />
11+
<Content Include="@(Protobuf)" LinkBase="" />
12+
</ItemGroup>
13+
14+
<ItemGroup>
15+
<PackageReference Include="Grpc.Core" Version="${GrpcCorePackageVersion}" />
16+
<PackageReference Include="Google.Protobuf" Version="${GoogleProtobufPackageVersion}" />
17+
18+
<PackageReference Include="Grpc.Tools" Version="${GrpcToolsPackageVersion}" PrivateAssets="All" />
19+
</ItemGroup>
20+
21+
</Project>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netcoreapp3.0</TargetFramework>
5+
</PropertyGroup>
6+
7+
<ItemGroup>
8+
<Protobuf Include="..\Protos\*.proto" GrpcServices="Server" />
9+
<Content Include="@(Protobuf)" LinkBase="" />
10+
</ItemGroup>
11+
12+
<ItemGroup>
13+
<PackageReference Include="Grpc.AspNetCore.Server" Version="${GrpcAspNetCoreServerPackageVersion}" />
14+
<PackageReference Include="Google.Protobuf" Version="${GoogleProtobufPackageVersion}" />
15+
16+
<PackageReference Include="Grpc.Tools" Version="${GrpcToolsPackageVersion}" PrivateAssets="All" />
17+
</ItemGroup>
18+
19+
</Project>

src/ProjectTemplates/Web.ProjectTemplates/Microsoft.DotNet.Web.ProjectTemplates.csproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
<PropertyGroup>
1313
<!-- Lists the versions of dependencies not built in this repo. Packages produced from this repo should be listed as a PackageVersionVariableReference. -->
1414
<GeneratedContentProperties>
15+
GoogleProtobufPackageVersion=$(GoogleProtobufPackageVersion);
16+
GrpcAspNetCoreServerPackageVersion=$(GrpcAspNetCoreServerPackageVersion);
17+
GrpcCorePackageVersion=$(GrpcCorePackageVersion);
18+
GrpcToolsPackageVersion=$(GrpcToolsPackageVersion);
1519
MicrosoftAspNetCoreMvcRazorRuntimeCompilationPackageVersion=$(MicrosoftAspNetCoreMvcRazorRuntimeCompilationPackageVersion);
1620
MicrosoftEntityFrameworkCoreSqlitePackageVersion=$(MicrosoftEntityFrameworkCoreSqlitePackageVersion);
1721
MicrosoftEntityFrameworkCoreSqlServerPackageVersion=$(MicrosoftEntityFrameworkCoreSqlServerPackageVersion);
@@ -39,6 +43,8 @@
3943
<ItemGroup>
4044
<GeneratedContent Include="EmptyWeb-CSharp.csproj.in" OutputPath="content/EmptyWeb-CSharp/Company.WebApplication1.csproj" />
4145
<GeneratedContent Include="EmptyWeb-FSharp.fsproj.in" OutputPath="content/EmptyWeb-FSharp/Company.WebApplication1.fsproj" />
46+
<GeneratedContent Include="GrpcService-CSharp.Server.csproj.in" OutputPath="content/GrpcService-CSharp/GrpcService-CSharp.Server/GrpcService-CSharp.Server.csproj" />
47+
<GeneratedContent Include="GrpcService-CSharp.Client.csproj.in" OutputPath="content/GrpcService-CSharp/GrpcService-CSharp.Client/GrpcService-CSharp.Client.csproj" />
4248
<GeneratedContent Include="RazorComponentsWeb-CSharp.csproj.in" OutputPath="content/RazorComponentsWeb-CSharp/RazorComponentsWeb-CSharp.csproj" />
4349
<GeneratedContent Include="RazorPagesWeb-CSharp.csproj.in" OutputPath="content/RazorPagesWeb-CSharp/Company.WebApplication1.csproj" />
4450
<GeneratedContent Include="RazorClassLibrary-CSharp.csproj.in" OutputPath="content/RazorClassLibrary-CSharp/Company.RazorClassLibrary1.csproj" />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "http://json.schemastore.org/dotnetcli.host",
3+
"symbolInfo": {
4+
"skipRestore": {
5+
"longName": "no-restore",
6+
"shortName": ""
7+
},
8+
"ExcludeLaunchSettings": {
9+
"longName": "exclude-launch-settings",
10+
"shortName": ""
11+
}
12+
},
13+
"usageExamples": [
14+
""
15+
]
16+
}
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
{
2+
"$schema": "http://json.schemastore.org/template",
3+
"author": "Microsoft",
4+
"classifications": [
5+
"Web",
6+
"gRPC"
7+
],
8+
"name": "ASP.NET Core gRPC Service",
9+
"generatorVersions": "[1.0.0.0-*)",
10+
"description": "A project template for creating a gRPC ASP.NET Core service.",
11+
"groupIdentity": "Microsoft.Web.Grpc",
12+
"precedence": "5000",
13+
"identity": "Microsoft.Grpc.Service.CSharp.3.0",
14+
"shortName": "grpc",
15+
"tags": {
16+
"language": "C#",
17+
"type": "project"
18+
},
19+
"sourceName": "GrpcService-CSharp",
20+
"preferNameDirectory": true,
21+
"guids": [
22+
"4C26868E-5E7C-458D-82E3-040509D0C71F",
23+
"5990939C-7E7B-4CFA-86FF-44CA5756498A",
24+
"650B3CE7-2E93-4CC4-9F46-466686815EAA"
25+
],
26+
"sources": [
27+
{
28+
"modifiers": [
29+
{
30+
"condition": "(ExcludeLaunchSettings)",
31+
"exclude": [
32+
"GrpcService-CSharp.Server/Properties/launchSettings.json"
33+
]
34+
},
35+
{
36+
"condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")",
37+
"exclude": [
38+
"GrpcService-CSharp.sln"
39+
]
40+
}
41+
]
42+
}
43+
],
44+
"symbols": {
45+
"HostIdentifier": {
46+
"type": "bind",
47+
"binding": "HostIdentifier"
48+
},
49+
"Framework": {
50+
"type": "parameter",
51+
"description": "The target framework for the project.",
52+
"datatype": "choice",
53+
"choices": [
54+
{
55+
"choice": "netcoreapp3.0",
56+
"description": "Target netcoreapp3.0"
57+
}
58+
],
59+
"defaultValue": "netcoreapp3.0"
60+
},
61+
"ExcludeLaunchSettings": {
62+
"type": "parameter",
63+
"datatype": "bool",
64+
"defaultValue": "false",
65+
"description": "Whether to exclude launchSettings.json from the generated template."
66+
},
67+
"skipRestore": {
68+
"type": "parameter",
69+
"datatype": "bool",
70+
"description": "If specified, skips the automatic restore of the project on create.",
71+
"defaultValue": "false"
72+
}
73+
},
74+
"primaryOutputs": [
75+
{
76+
"condition": "(HostIdentifier == \"dotnetcli\" || HostIdentifier == \"dotnetcli-preview\")",
77+
"path": "GrpcService-CSharp.sln"
78+
},
79+
{
80+
"condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")",
81+
"path": "GrpcService-CSharp.Server/GrpcService-CSharp.Server.csproj"
82+
},
83+
{
84+
"condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")",
85+
"path": "GrpcService-CSharp.Client/GrpcService-CSharp.Client.csproj"
86+
}
87+
],
88+
"defaultName": "GrpcService-CSharp1",
89+
"postActions": [
90+
{
91+
"condition": "(!skipRestore)",
92+
"description": "Restore NuGet packages required by this project.",
93+
"manualInstructions": [
94+
{
95+
"text": "Run 'dotnet restore'"
96+
}
97+
],
98+
"actionId": "210D431B-A78B-4D2F-B762-4ED3E3EA9025",
99+
"continueOnError": true
100+
}
101+
]
102+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"$schema": "http://json.schemastore.org/vs-2017.3.host",
3+
"name": {
4+
"text": "gRPC Service",
5+
"package": "{0CD94836-1526-4E85-87D3-FB5274C5AFC9}",
6+
"id": "1027"
7+
},
8+
"description": {
9+
"text": "A project template for creating a gRPC ASP.NET Core service.",
10+
"package": "{0CD94836-1526-4E85-87D3-FB5274C5AFC9}",
11+
"id": "1028"
12+
},
13+
"order": 100,
14+
"icon": "vs-2017.3/Empty.png",
15+
"learnMoreLink": "https://go.microsoft.com/fwlink/?LinkID=784883",
16+
"uiFilters": [ "oneaspnet" ],
17+
"supportsDocker": true,
18+
"excludeLaunchSettings": false
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.IO;
4+
using System.Linq;
5+
using System.Threading.Tasks;
6+
using Greet;
7+
using Grpc.Core;
8+
9+
namespace GrpcService_CSharp
10+
{
11+
public class Program
12+
{
13+
static async Task Main(string[] args)
14+
{
15+
// Include port of the gRPC server as an application argument
16+
var port = args.Length > 0 ? args[0] : "50051";
17+
18+
var channel = new Channel("localhost:" + port, ChannelCredentials.Insecure);
19+
var client = new Greeter.GreeterClient(channel);
20+
21+
var reply = await client.SayHelloAsync(new HelloRequest { Name = "GreeterClient" });
22+
Console.WriteLine("Greeting: " + reply.Message);
23+
24+
await channel.ShutdownAsync();
25+
26+
Console.WriteLine("Press any key to exit...");
27+
Console.ReadKey();
28+
}
29+
}
30+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.IO;
4+
using System.Linq;
5+
using System.Threading.Tasks;
6+
using Microsoft.AspNetCore.Hosting;
7+
using Microsoft.Extensions.Hosting;
8+
9+
namespace GrpcService_CSharp
10+
{
11+
public class Program
12+
{
13+
public static void Main(string[] args)
14+
{
15+
CreateHostBuilder(args).Build().Run();
16+
}
17+
18+
public static IHostBuilder CreateHostBuilder(string[] args) =>
19+
Host.CreateDefaultBuilder(args)
20+
.ConfigureWebHostDefaults(webBuilder =>
21+
{
22+
webBuilder.UseStartup<Startup>();
23+
});
24+
}
25+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"profiles": {
3+
"GrpcService-CSharp": {
4+
"commandName": "Project",
5+
"launchBrowser": false,
6+
"applicationUrl": "http://localhost:50051",
7+
"environmentVariables": {
8+
"ASPNETCORE_ENVIRONMENT": "Development"
9+
}
10+
}
11+
}
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
using Greet;
6+
using Grpc.Core;
7+
8+
namespace GrpcService_CSharp
9+
{
10+
public class GreeterService : Greeter.GreeterBase
11+
{
12+
public override Task<HelloReply> SayHello(HelloRequest request, ServerCallContext context)
13+
{
14+
return Task.FromResult(new HelloReply
15+
{
16+
Message = "Hello " + request.Name
17+
});
18+
}
19+
}
20+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
using Microsoft.AspNetCore.Builder;
6+
using Microsoft.AspNetCore.Hosting;
7+
using Microsoft.Extensions.DependencyInjection;
8+
using Microsoft.Extensions.Hosting;
9+
10+
namespace GrpcService_CSharp
11+
{
12+
public class Startup
13+
{
14+
// This method gets called by the runtime. Use this method to add services to the container.
15+
// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
16+
public void ConfigureServices(IServiceCollection services)
17+
{
18+
services.AddGrpc();
19+
}
20+
21+
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
22+
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
23+
{
24+
if (env.IsDevelopment())
25+
{
26+
app.UseDeveloperExceptionPage();
27+
}
28+
29+
app.UseRouting(routes =>
30+
{
31+
routes.MapGrpcService<GreeterService>();
32+
});
33+
}
34+
}
35+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"Logging": {
3+
"LogLevel": {
4+
"Default": "Debug",
5+
"System": "Information",
6+
"Microsoft": "Information"
7+
}
8+
}
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"Logging": {
3+
"LogLevel": {
4+
"Default": "Warning",
5+
"Microsoft.Hosting.Lifetime": "Information"
6+
}
7+
},
8+
"AllowedHosts": "*",
9+
"Kestrel": {
10+
"EndpointDefaults": {
11+
"Protocols": "Http2"
12+
}
13+
}
14+
}

0 commit comments

Comments
 (0)