mirror of https://github.com/grpc/grpc-dotnet.git
Compare commits
643 Commits
v2.28.0-pr
...
master
Author | SHA1 | Date |
---|---|---|
|
4ee90d83ce | |
|
fc1f6db9fd | |
|
f31cd71abf | |
|
0045d7d123 | |
|
d07efb500c | |
|
9764314a84 | |
|
3bd324e325 | |
|
add543720d | |
|
44b243fb00 | |
|
66df240b07 | |
|
1cb0fdb29a | |
|
85787a7ce2 | |
|
d170b24e9d | |
|
b1af190d8c | |
|
6f03f0e0b5 | |
|
30553b5624 | |
|
2aed7b5ef3 | |
|
06cd2a9f7a | |
|
5816e69828 | |
|
147a4647ad | |
|
852a118c7b | |
|
60d9d2ce15 | |
|
a2f7d06e02 | |
|
c9d26719e8 | |
|
b7af033360 | |
|
6a3c9774f6 | |
|
cacf59d942 | |
|
be98a74f68 | |
|
42593dde65 | |
|
651a0cb64a | |
|
3bf19a113c | |
|
b6cfbd05e9 | |
|
5a58c24efc | |
|
dacb7b41ea | |
|
1732f28dc6 | |
|
5fffc489f7 | |
|
b88713e83f | |
|
0f2ffdc03e | |
|
490894cded | |
|
df3d8dc996 | |
|
b1df3e4c76 | |
|
de9a82fe8e | |
|
3ed9fb9f31 | |
|
5322d6b813 | |
|
439a3b80b5 | |
|
b3429b9061 | |
|
30255261ad | |
|
bf41c89ace | |
|
e9cc7e1579 | |
|
26227c3e7a | |
|
dd4adce098 | |
|
c397bc7804 | |
|
74ee5f0ebf | |
|
a732f517ea | |
|
a156ca9955 | |
|
cd875d9097 | |
|
540e87bf70 | |
|
b34d553e44 | |
|
35b63dad57 | |
|
6448783899 | |
|
aab5b2b798 | |
|
4623318100 | |
|
1416340c85 | |
|
64f6a0958a | |
|
434a5ba26b | |
|
5e6821cbe3 | |
|
b57c87f2a9 | |
|
775d1fba1c | |
|
0ea0112ec8 | |
|
84a4fcb697 | |
|
bca64852ba | |
|
ef1f0d209c | |
|
9ad10a9196 | |
|
4b6ecea955 | |
|
989420e709 | |
|
c80f4594d0 | |
|
63914f2653 | |
|
8199f66422 | |
|
2d9df5892c | |
|
c9c902c8da | |
|
2a36215697 | |
|
9cd97cebca | |
|
c04d01a0ac | |
|
add886e45b | |
|
f2709f1bf5 | |
|
a4d83f6d75 | |
|
a51fec8ff1 | |
|
874cd11637 | |
|
933023b6f8 | |
|
f29d927f42 | |
|
098dca892a | |
|
787faa64c7 | |
|
da2038226c | |
|
7cd4bc2447 | |
|
6d1ea08ce3 | |
|
1a8435477f | |
|
7f5b4574aa | |
|
3103c6937f | |
|
0cad7497d0 | |
|
4b0b3589db | |
|
e5c9528912 | |
|
abaaf4415c | |
|
934bcec442 | |
|
f075c79e18 | |
|
87cce280d7 | |
|
998a8cc63b | |
|
1625f89427 | |
|
2bbb977dd2 | |
|
ca9b756d73 | |
|
4a60f414a1 | |
|
e5afb085e0 | |
|
5e505b017a | |
|
8d33f094d2 | |
|
e52049a94d | |
|
51ad5ab757 | |
|
3c4abbada1 | |
|
91be3925c1 | |
|
683fbdfa5c | |
|
bad41ff570 | |
|
207e8066f3 | |
|
97f6fbd3fe | |
|
7e62218646 | |
|
46480fca2f | |
|
40a26c9877 | |
|
246c43d457 | |
|
91130a7c89 | |
|
3f90844449 | |
|
b50e46f851 | |
|
311f8784c6 | |
|
b421751176 | |
|
41f67ad900 | |
|
a9e810c3df | |
|
6429ae2f57 | |
|
3db1683820 | |
|
01049834be | |
|
ca3f2b9d51 | |
|
aa2bc14f5e | |
|
a970fec15d | |
|
89dd217257 | |
|
2b1da779bf | |
|
6ca24ef45b | |
|
5a8e2baf37 | |
|
854e0fd3d0 | |
|
22a9549897 | |
|
870bf8443f | |
|
89e6611d2d | |
|
a61e11f1e0 | |
|
d49fbe40d5 | |
|
4367702140 | |
|
d305ee4bc6 | |
|
19e059f073 | |
|
cec98b28d5 | |
|
6420a8cf9f | |
|
6a4bca703a | |
|
a2d005c86b | |
|
1d1234064c | |
|
0ab3ada34a | |
|
bff852c7f1 | |
|
e0677497de | |
|
03d9b01fbb | |
|
6307ca7ead | |
|
8275c602a9 | |
|
1e32a39efa | |
|
5751c4dd3e | |
|
067bfc8fd8 | |
|
d884b50a27 | |
|
85f34398df | |
|
16e01b9369 | |
|
42cc09eb8f | |
|
83d12ea1cb | |
|
99604e5a9a | |
|
bc6da06036 | |
|
5a2887497e | |
|
266be407f6 | |
|
c72ada62e6 | |
|
2be676ad3b | |
|
73c726bf4e | |
|
697f3492f2 | |
|
ff1a07b90c | |
|
6bc44e97d7 | |
|
f9a00bc490 | |
|
2dc971e013 | |
|
1412c31924 | |
|
a95f0f08e9 | |
|
7786079da6 | |
|
38738af700 | |
|
9427a740a4 | |
|
b83aece3cf | |
|
8af472314e | |
|
94a8167500 | |
|
e270f816b4 | |
|
6bf44820a2 | |
|
0998624ce9 | |
|
54d7f29913 | |
|
b82c0c7354 | |
|
fb315ca62b | |
|
c24dfebe22 | |
|
95cf7fc928 | |
|
f056e80af0 | |
|
23cd81fbdb | |
|
cfb839bd7c | |
|
c2274eb07d | |
|
a456d47405 | |
|
84718236a9 | |
|
0b365bf463 | |
|
0f9300c439 | |
|
ad54bc69ed | |
|
fc4d087d63 | |
|
674758e4d3 | |
|
2cdbf1c308 | |
|
4bf9312123 | |
|
0a26b0cad6 | |
|
b81a92d17b | |
|
4c07771aea | |
|
948be08b08 | |
|
96ea3836b4 | |
|
33f6ae36c9 | |
|
b92eb109f1 | |
|
f7e186f18e | |
|
2ea8177bc8 | |
|
3a356b3719 | |
|
ff89215fbc | |
|
9ab0b4508f | |
|
d2c8146302 | |
|
d2c5a7a5b9 | |
|
8474b75b41 | |
|
d4704d8f44 | |
|
11e7cfa3da | |
|
1a9cf64a72 | |
|
5a0b1eec01 | |
|
17ef8fdbe5 | |
|
cb88ac90ca | |
|
c72d1a82a5 | |
|
3ae11a4cef | |
|
a98c6218e0 | |
|
664f5559f6 | |
|
e28a43ffed | |
|
bb406e8bfa | |
|
80e2fabcf9 | |
|
23047e0d49 | |
|
91ac7754f2 | |
|
faf6234b3d | |
|
25f7b137d7 | |
|
97b7f6d4d7 | |
|
0828c036bb | |
|
6c48114e67 | |
|
7154cb470d | |
|
4c2e66ed85 | |
|
45dd5d171c | |
|
947a24aefe | |
|
22ac73b110 | |
|
e7fd8004c0 | |
|
e86adbf656 | |
|
3617dc1c78 | |
|
cb02fb7e8f | |
|
ad67dc8d27 | |
|
456098bcfe | |
|
371d74fc95 | |
|
0f5c5782e3 | |
|
0ab5e2c509 | |
|
9950fd717b | |
|
9852674a88 | |
|
54fa142547 | |
|
195e1c0922 | |
|
7980069be0 | |
|
884d918e3c | |
|
792eb3b570 | |
|
8ae9c96c18 | |
|
937869c130 | |
|
2116d1efce | |
|
7bfd8e385a | |
|
922d314630 | |
|
0551be8b6b | |
|
1d7f98834c | |
|
4f06b601aa | |
|
77ae8af69c | |
|
d250e28e70 | |
|
4e9077c9ae | |
|
3934c6c702 | |
|
a3717a3587 | |
|
ca40f28ab7 | |
|
5ff18048d1 | |
|
9d0919fe05 | |
|
c319c44ec8 | |
|
25c2b9115a | |
|
b77a58963b | |
|
a984c6d55c | |
|
7a6e2fe207 | |
|
5f587ae2e0 | |
|
6507e9bf37 | |
|
2923260a0c | |
|
de472b186c | |
|
d9755701cf | |
|
cbb0836991 | |
|
78d11d14ad | |
|
6bbbf36277 | |
|
58cd9dc9cb | |
|
543c363c5e | |
|
2c175e01ca | |
|
f850d75d85 | |
|
0ddbb72c3e | |
|
c0779fc83f | |
|
fedf5ab017 | |
|
1f5186e6a7 | |
|
4b10c6c7bf | |
|
e616db6506 | |
|
9e073cd6e6 | |
|
52c6154435 | |
|
be641b6ffe | |
|
248c580a7c | |
|
7cf2aa077c | |
|
d7cf5a83dd | |
|
3f63a9ac94 | |
|
3ac2881a7a | |
|
c46859372f | |
|
38845e5523 | |
|
819dea5af6 | |
|
7d2c3c169a | |
|
7d013e0121 | |
|
a2c907f69d | |
|
24245fd677 | |
|
5982753253 | |
|
770947bd25 | |
|
c9b8aa7dec | |
|
af4a858335 | |
|
713935fbf7 | |
|
d2cc71676a | |
|
0ebfff1e83 | |
|
db0dafc78a | |
|
2bb25cab6c | |
|
197b43bbf7 | |
|
d02f71a759 | |
|
70dd439625 | |
|
4728d65414 | |
|
d45c350307 | |
|
737f712afe | |
|
bfe312a3ba | |
|
295165518d | |
|
87680d504a | |
|
bbbfdc0f02 | |
|
9f83f9b5ef | |
|
6d3e6af1e1 | |
|
f238855fcb | |
|
d0272085d9 | |
|
ea5f673c10 | |
|
1cc747cfbf | |
|
0551d6aa2e | |
|
b401c2c7e3 | |
|
05c25a3c5e | |
|
502648751e | |
|
d4ee8babcd | |
|
b001e02756 | |
|
41b8e2e76a | |
|
f47ac6bfb8 | |
|
f01df42b02 | |
|
7057da7ae7 | |
|
15d027bc93 | |
|
5c206d0e9f | |
|
b3e8ba64ee | |
|
85b92220ec | |
|
5641257032 | |
|
a007d43bc7 | |
|
bdcd0eaf12 | |
|
11d7151e7f | |
|
fa546befa2 | |
|
21a1412b87 | |
|
aed01fe9f4 | |
|
137e377efb | |
|
306abc2979 | |
|
915b15de18 | |
|
1d60a7c02d | |
|
282fa2af8f | |
|
82f89083ed | |
|
3a355c21c7 | |
|
1d18ed324b | |
|
7b95a53cf2 | |
|
3add750544 | |
|
a08e7372ff | |
|
da6dcc5ca2 | |
|
6cc34ee5e7 | |
|
257da89bf1 | |
|
ea7a00e7e2 | |
|
687fbb44a0 | |
|
1215046255 | |
|
6d4892c487 | |
|
2ff1f4ef8e | |
|
eb813a798a | |
|
518a6362ba | |
|
a04684ab23 | |
|
a23602367d | |
|
1ac3a3f3be | |
|
9c936f3ca5 | |
|
6acecf4ad4 | |
|
3ebcc938a9 | |
|
8fa8389812 | |
|
bce585246d | |
|
7d081d7c26 | |
|
520c57415e | |
|
d5626ab20b | |
|
d2035de5f6 | |
|
fb42fc0c8a | |
|
16a1bb4ca4 | |
|
78bf205a90 | |
|
747088e5b8 | |
|
b9cb8806ae | |
|
0d5a300154 | |
|
868adfe377 | |
|
f5e4ad7384 | |
|
7ef184f3c4 | |
|
5d447fdc8e | |
|
dce1ef72d8 | |
|
202985251b | |
|
e48a0364d5 | |
|
00f7601709 | |
|
763d3b99a3 | |
|
a7c6c47bc4 | |
|
b1e7b44387 | |
|
b04688b437 | |
|
530eb1c25c | |
|
82dec0ff51 | |
|
a9b0064a66 | |
|
d5682d4823 | |
|
afe2100cda | |
|
c85ca5c432 | |
|
48eb2e9074 | |
|
f777808fa1 | |
|
cb2f9d7826 | |
|
17b2beb9b7 | |
|
b63993f40d | |
|
056e386ad9 | |
|
c1d3bbfccd | |
|
ac3b3f4309 | |
|
3469513fe7 | |
|
5f762ae977 | |
|
8666a11362 | |
|
0f26bd7b2f | |
|
7c35727de4 | |
|
a01ea842a7 | |
|
bb9284fb62 | |
|
094532f0fb | |
|
7be660d629 | |
|
c804021ac3 | |
|
15158af86d | |
|
95ea1dcb1b | |
|
e3a2c06639 | |
|
36df3c2e31 | |
|
a6eccf0dc3 | |
|
11f0958d12 | |
|
1cd34bd832 | |
|
f77622b3bd | |
|
f552a4982f | |
|
d585f36132 | |
|
420ca57ac2 | |
|
e920c52048 | |
|
8db4604542 | |
|
8b30ef9c7a | |
|
a1389a0811 | |
|
bf26e0377a | |
|
6920e2abd0 | |
|
f54a118569 | |
|
5bb5f48fc4 | |
|
31009f6de1 | |
|
5d223d540e | |
|
e0b839290f | |
|
560e141e68 | |
|
4c410dcc39 | |
|
650aaa110f | |
|
2ab0587190 | |
|
9f72e70c6a | |
|
ebf7bbd9b2 | |
|
bb14b9b2ea | |
|
85883a2d4b | |
|
2844af7c2c | |
|
7f341664d6 | |
|
78306e4723 | |
|
57a7ad5339 | |
|
7e3f2c3115 | |
|
6fd69504c7 | |
|
4f61419d80 | |
|
45ab5036e7 | |
|
b93d87eff1 | |
|
b95400a20f | |
|
ab79d7fc40 | |
|
b8a2408f18 | |
|
250331e390 | |
|
761bfe8f71 | |
|
be36d78d79 | |
|
4b4a7bd2b5 | |
|
37653639d6 | |
|
978200abd5 | |
|
5c7cf6cf33 | |
|
37660f5de4 | |
|
a72397cebb | |
|
08024e350d | |
|
3c675bed8f | |
|
927c0e5d72 | |
|
538e3720a6 | |
|
9c3385ad84 | |
|
4a8a120317 | |
|
a3e67446a2 | |
|
822c36fea4 | |
|
76ae64d3b0 | |
|
d8d982b291 | |
|
ec6de5c047 | |
|
e34cef6c64 | |
|
7d6683e3b3 | |
|
ab2efbaed1 | |
|
df29d5274c | |
|
291ddf395c | |
|
543ee70bc8 | |
|
4da20fba32 | |
|
bbf8ffe982 | |
|
ac2523fc2a | |
|
04b0a1cdb7 | |
|
c637a4e9f1 | |
|
dfd2cb3f96 | |
|
850f455753 | |
|
cd2e76860c | |
|
a435b71956 | |
|
123ae72fb5 | |
|
dd4dca5b7b | |
|
e7e779f35f | |
|
922b8dfd39 | |
|
13a4bf1b2d | |
|
c48ae4442f | |
|
bf3b057e32 | |
|
3807a8cb58 | |
|
e37e2f13a1 | |
|
874cb5535e | |
|
e36e1218e9 | |
|
96c06f45e7 | |
|
be778112dc | |
|
4827aea48d | |
|
00d6a0b4a8 | |
|
27257a7c3b | |
|
3518cd7570 | |
|
a2918b07a2 | |
|
5395000b37 | |
|
86f4600121 | |
|
f418e5d5f7 | |
|
11a7146c9e | |
|
637afdbec6 | |
|
59062ec54d | |
|
7fe4595de9 | |
|
139040e840 | |
|
0a37300796 | |
|
84f6a3e7d0 | |
|
a76308fd2b | |
|
47b7506e1f | |
|
1e82c56974 | |
|
cc7b97f6da | |
|
b10480cbe0 | |
|
fdb96193ba | |
|
a9827e5ccc | |
|
55cde44349 | |
|
af709ddf42 | |
|
5faaabef72 | |
|
4bf32368ee | |
|
ef77760676 | |
|
6df196c110 | |
|
4c92b23cfb | |
|
c42358b2c3 | |
|
1b44bef567 | |
|
49fc4f1841 | |
|
634fda1fec | |
|
797619b329 | |
|
aca0a8def5 | |
|
75c5cbb082 | |
|
e911dac2e5 | |
|
39c2dcd78e | |
|
6b65f9b2ad | |
|
59ac331075 | |
|
27cf289089 | |
|
02883fb00d | |
|
08a0a558c7 | |
|
9c294e0394 | |
|
b9f862170a | |
|
7e8b6e85f1 | |
|
4daaf07a26 | |
|
e02fd189d1 | |
|
ba05ea11b8 | |
|
e1669ed6f2 | |
|
8251675415 | |
|
ff32e56713 | |
|
64efb1cd68 | |
|
f89cfc2fa9 | |
|
283098b2d5 | |
|
9b759a54d0 | |
|
241b21df05 | |
|
1344beb663 | |
|
c2cf53641f | |
|
074b17a573 | |
|
90c0ecc41c | |
|
32df65a6c3 | |
|
5de614014d | |
|
103105e75f | |
|
9bc4d27d39 | |
|
41618a497b | |
|
90609adec0 | |
|
1b3588ca21 | |
|
97af9b2fa5 | |
|
035c791b10 | |
|
38ea7e8441 | |
|
54add4f70f | |
|
4d7cad8e00 | |
|
f182c41f1f | |
|
52165289fe | |
|
cf09aafced | |
|
1df26fe32d | |
|
bba2e5d385 | |
|
f99787e28f | |
|
6f452e10b7 | |
|
1ca4245af8 | |
|
70d9728aa7 | |
|
305cb17e2a | |
|
3ce9b10452 | |
|
95159e54c7 | |
|
c6b8f6c706 | |
|
58b2e1c9b3 | |
|
cb7c70e2ef | |
|
a5d970b5f2 | |
|
554ea26113 | |
|
262de5b28c | |
|
afc2b21761 | |
|
fced036711 | |
|
dfb34ae672 | |
|
2c2b8adf43 | |
|
04bbe4fc59 | |
|
57fa08534b | |
|
03778703f3 | |
|
95c99074b0 | |
|
799a8a1f66 | |
|
5dd0eef830 | |
|
5c6080a204 | |
|
adf4deb6ed | |
|
3a9b23de55 | |
|
b26695aceb | |
|
a656d7abb6 | |
|
cc00b55b06 | |
|
0b5320af97 | |
|
663b228bdb | |
|
76abb53787 | |
|
4864460865 |
|
@ -0,0 +1,3 @@
|
|||
**/bin
|
||||
**/obj
|
||||
.vs
|
|
@ -0,0 +1,406 @@
|
|||
; EditorConfig to support per-solution formatting.
|
||||
; Use the EditorConfig VS add-in to make this work.
|
||||
; http://editorconfig.org/
|
||||
;
|
||||
; Here are some resources for what's supported for .NET/C#
|
||||
; https://kent-boogaart.com/blog/editorconfig-reference-for-c-developers
|
||||
; https://learn.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference
|
||||
;
|
||||
; Be **careful** editing this because some of the rules don't support adding a severity level
|
||||
; For instance if you change to `dotnet_sort_system_directives_first = true:warning` (adding `:warning`)
|
||||
; then the rule will be silently ignored.
|
||||
|
||||
; This is the default for the codeline.
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.cs]
|
||||
indent_size = 4
|
||||
dotnet_sort_system_directives_first = true
|
||||
|
||||
# Don't use this. qualifier
|
||||
dotnet_style_qualification_for_field = false:suggestion
|
||||
dotnet_style_qualification_for_property = false:suggestion
|
||||
|
||||
# use int x = .. over Int32
|
||||
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
|
||||
|
||||
# use int.MaxValue over Int32.MaxValue
|
||||
dotnet_style_predefined_type_for_member_access = true:suggestion
|
||||
|
||||
# Require var all the time.
|
||||
csharp_style_var_for_built_in_types = true:suggestion
|
||||
csharp_style_var_when_type_is_apparent = true:suggestion
|
||||
csharp_style_var_elsewhere = true:suggestion
|
||||
|
||||
# Disallow throw expressions.
|
||||
csharp_style_throw_expression = false:suggestion
|
||||
|
||||
# Newline settings
|
||||
csharp_new_line_before_open_brace = all
|
||||
csharp_new_line_before_else = true
|
||||
csharp_new_line_before_catch = true
|
||||
csharp_new_line_before_finally = true
|
||||
csharp_new_line_before_members_in_object_initializers = true
|
||||
csharp_new_line_before_members_in_anonymous_types = true
|
||||
|
||||
# Namespace settings
|
||||
csharp_style_namespace_declarations = file_scoped
|
||||
|
||||
# Brace settings
|
||||
csharp_prefer_braces = true # Prefer curly braces even for one line of code
|
||||
|
||||
[*.{xml,config,*proj,nuspec,props,resx,targets,yml,tasks}]
|
||||
indent_size = 2
|
||||
|
||||
# Xml config files
|
||||
[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
|
||||
indent_size = 2
|
||||
|
||||
[*.json]
|
||||
indent_size = 2
|
||||
|
||||
[*.{ps1,psm1}]
|
||||
indent_size = 4
|
||||
|
||||
[*.sh]
|
||||
indent_size = 4
|
||||
end_of_line = lf
|
||||
|
||||
[*.{razor,cshtml}]
|
||||
charset = utf-8-bom
|
||||
|
||||
[*.{cs,vb}]
|
||||
|
||||
# SYSLIB1054: Use 'LibraryImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time
|
||||
dotnet_diagnostic.SYSLIB1054.severity = warning
|
||||
|
||||
# CA1018: Mark attributes with AttributeUsageAttribute
|
||||
dotnet_diagnostic.CA1018.severity = warning
|
||||
|
||||
# CA1047: Do not declare protected member in sealed type
|
||||
dotnet_diagnostic.CA1047.severity = warning
|
||||
|
||||
# CA1305: Specify IFormatProvider
|
||||
dotnet_diagnostic.CA1305.severity = warning
|
||||
|
||||
# CA1507: Use nameof to express symbol names
|
||||
dotnet_diagnostic.CA1507.severity = warning
|
||||
|
||||
# CA1510: Use ArgumentNullException throw helper
|
||||
dotnet_diagnostic.CA1510.severity = warning
|
||||
|
||||
# CA1511: Use ArgumentException throw helper
|
||||
dotnet_diagnostic.CA1511.severity = warning
|
||||
|
||||
# CA1512: Use ArgumentOutOfRangeException throw helper
|
||||
dotnet_diagnostic.CA1512.severity = warning
|
||||
|
||||
# CA1513: Use ObjectDisposedException throw helper
|
||||
dotnet_diagnostic.CA1513.severity = warning
|
||||
|
||||
# CA1725: Parameter names should match base declaration
|
||||
dotnet_diagnostic.CA1725.severity = suggestion
|
||||
|
||||
# CA1802: Use literals where appropriate
|
||||
dotnet_diagnostic.CA1802.severity = warning
|
||||
|
||||
# CA1805: Do not initialize unnecessarily
|
||||
dotnet_diagnostic.CA1805.severity = warning
|
||||
|
||||
# CA1810: Do not initialize unnecessarily
|
||||
dotnet_diagnostic.CA1810.severity = warning
|
||||
|
||||
# CA1821: Remove empty Finalizers
|
||||
dotnet_diagnostic.CA1821.severity = warning
|
||||
|
||||
# CA1822: Make member static
|
||||
dotnet_diagnostic.CA1822.severity = warning
|
||||
dotnet_code_quality.CA1822.api_surface = private, internal
|
||||
|
||||
# CA1823: Avoid unused private fields
|
||||
dotnet_diagnostic.CA1823.severity = warning
|
||||
|
||||
# CA1825: Avoid zero-length array allocations
|
||||
dotnet_diagnostic.CA1825.severity = warning
|
||||
|
||||
# CA1826: Do not use Enumerable methods on indexable collections. Instead use the collection directly
|
||||
dotnet_diagnostic.CA1826.severity = warning
|
||||
|
||||
# CA1827: Do not use Count() or LongCount() when Any() can be used
|
||||
dotnet_diagnostic.CA1827.severity = warning
|
||||
|
||||
# CA1828: Do not use CountAsync() or LongCountAsync() when AnyAsync() can be used
|
||||
dotnet_diagnostic.CA1828.severity = warning
|
||||
|
||||
# CA1829: Use Length/Count property instead of Count() when available
|
||||
dotnet_diagnostic.CA1829.severity = warning
|
||||
|
||||
# CA1830: Prefer strongly-typed Append and Insert method overloads on StringBuilder
|
||||
dotnet_diagnostic.CA1830.severity = warning
|
||||
|
||||
# CA1831: Use AsSpan or AsMemory instead of Range-based indexers when appropriate
|
||||
# CA1832: Use AsSpan or AsMemory instead of Range-based indexers when appropriate
|
||||
# CA1833: Use AsSpan or AsMemory instead of Range-based indexers when appropriate
|
||||
dotnet_diagnostic.CA1831.severity = warning
|
||||
dotnet_diagnostic.CA1832.severity = warning
|
||||
dotnet_diagnostic.CA1833.severity = warning
|
||||
|
||||
# CA1834: Consider using 'StringBuilder.Append(char)' when applicable
|
||||
dotnet_diagnostic.CA1834.severity = warning
|
||||
|
||||
# CA1835: Prefer the 'Memory'-based overloads for 'ReadAsync' and 'WriteAsync'
|
||||
dotnet_diagnostic.CA1835.severity = warning
|
||||
|
||||
# CA1836: Prefer IsEmpty over Count
|
||||
dotnet_diagnostic.CA1836.severity = warning
|
||||
|
||||
# CA1837: Use 'Environment.ProcessId'
|
||||
dotnet_diagnostic.CA1837.severity = warning
|
||||
|
||||
# CA1838: Avoid 'StringBuilder' parameters for P/Invokes
|
||||
dotnet_diagnostic.CA1838.severity = warning
|
||||
|
||||
# CA1839: Use 'Environment.ProcessPath'
|
||||
dotnet_diagnostic.CA1839.severity = warning
|
||||
|
||||
# CA1840: Use 'Environment.CurrentManagedThreadId'
|
||||
dotnet_diagnostic.CA1840.severity = warning
|
||||
|
||||
# CA1841: Prefer Dictionary.Contains methods
|
||||
dotnet_diagnostic.CA1841.severity = warning
|
||||
|
||||
# CA1842: Do not use 'WhenAll' with a single task
|
||||
dotnet_diagnostic.CA1842.severity = warning
|
||||
|
||||
# CA1843: Do not use 'WaitAll' with a single task
|
||||
dotnet_diagnostic.CA1843.severity = warning
|
||||
|
||||
# CA1844: Provide memory-based overrides of async methods when subclassing 'Stream'
|
||||
dotnet_diagnostic.CA1844.severity = warning
|
||||
|
||||
# CA1845: Use span-based 'string.Concat'
|
||||
dotnet_diagnostic.CA1845.severity = warning
|
||||
|
||||
# CA1846: Prefer AsSpan over Substring
|
||||
dotnet_diagnostic.CA1846.severity = warning
|
||||
|
||||
# CA1847: Use string.Contains(char) instead of string.Contains(string) with single characters
|
||||
dotnet_diagnostic.CA1847.severity = warning
|
||||
|
||||
# CA1852: Seal internal types
|
||||
dotnet_diagnostic.CA1852.severity = warning
|
||||
|
||||
# CA1854: Prefer the IDictionary.TryGetValue(TKey, out TValue) method
|
||||
dotnet_diagnostic.CA1854.severity = warning
|
||||
|
||||
# CA1855: Prefer 'Clear' over 'Fill'
|
||||
dotnet_diagnostic.CA1855.severity = warning
|
||||
|
||||
# CA1856: Incorrect usage of ConstantExpected attribute
|
||||
dotnet_diagnostic.CA1856.severity = error
|
||||
|
||||
# CA1857: A constant is expected for the parameter
|
||||
dotnet_diagnostic.CA1857.severity = warning
|
||||
|
||||
# CA1858: Use 'StartsWith' instead of 'IndexOf'
|
||||
dotnet_diagnostic.CA1858.severity = warning
|
||||
|
||||
# CA2007: Consider calling ConfigureAwait on the awaited task
|
||||
dotnet_diagnostic.CA2007.severity = warning
|
||||
|
||||
# CA2008: Do not create tasks without passing a TaskScheduler
|
||||
dotnet_diagnostic.CA2008.severity = warning
|
||||
|
||||
# CA2009: Do not call ToImmutableCollection on an ImmutableCollection value
|
||||
dotnet_diagnostic.CA2009.severity = warning
|
||||
|
||||
# CA2011: Avoid infinite recursion
|
||||
dotnet_diagnostic.CA2011.severity = warning
|
||||
|
||||
# CA2012: Use ValueTask correctly
|
||||
dotnet_diagnostic.CA2012.severity = warning
|
||||
|
||||
# CA2013: Do not use ReferenceEquals with value types
|
||||
dotnet_diagnostic.CA2013.severity = warning
|
||||
|
||||
# CA2014: Do not use stackalloc in loops.
|
||||
dotnet_diagnostic.CA2014.severity = warning
|
||||
|
||||
# CA2016: Forward the 'CancellationToken' parameter to methods that take one
|
||||
dotnet_diagnostic.CA2016.severity = warning
|
||||
|
||||
# CA2200: Rethrow to preserve stack details
|
||||
dotnet_diagnostic.CA2200.severity = warning
|
||||
|
||||
# CA2208: Instantiate argument exceptions correctly
|
||||
dotnet_diagnostic.CA2208.severity = warning
|
||||
|
||||
# CA2245: Do not assign a property to itself
|
||||
dotnet_diagnostic.CA2245.severity = warning
|
||||
|
||||
# CA2246: Assigning symbol and its member in the same statement
|
||||
dotnet_diagnostic.CA2246.severity = warning
|
||||
|
||||
# CA2249: Use string.Contains instead of string.IndexOf to improve readability.
|
||||
dotnet_diagnostic.CA2249.severity = warning
|
||||
|
||||
# IDE0005: Remove unnecessary usings
|
||||
dotnet_diagnostic.IDE0005.severity = warning
|
||||
|
||||
# IDE0011: Curly braces to surround blocks of code
|
||||
dotnet_diagnostic.IDE0011.severity = warning
|
||||
|
||||
# IDE0020: Use pattern matching to avoid is check followed by a cast (with variable)
|
||||
dotnet_diagnostic.IDE0020.severity = warning
|
||||
|
||||
# IDE0029: Use coalesce expression (non-nullable types)
|
||||
dotnet_diagnostic.IDE0029.severity = warning
|
||||
|
||||
# IDE0030: Use coalesce expression (nullable types)
|
||||
dotnet_diagnostic.IDE0030.severity = warning
|
||||
|
||||
# IDE0031: Use null propagation
|
||||
dotnet_diagnostic.IDE0031.severity = warning
|
||||
|
||||
# IDE0035: Remove unreachable code
|
||||
dotnet_diagnostic.IDE0035.severity = warning
|
||||
|
||||
# IDE0036: Order modifiers
|
||||
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
|
||||
dotnet_diagnostic.IDE0036.severity = warning
|
||||
|
||||
# IDE0038: Use pattern matching to avoid is check followed by a cast (without variable)
|
||||
dotnet_diagnostic.IDE0038.severity = warning
|
||||
|
||||
# IDE0043: Format string contains invalid placeholder
|
||||
dotnet_diagnostic.IDE0043.severity = warning
|
||||
|
||||
# IDE0044: Make field readonly
|
||||
dotnet_diagnostic.IDE0044.severity = warning
|
||||
|
||||
# IDE0051: Remove unused private members
|
||||
dotnet_diagnostic.IDE0051.severity = warning
|
||||
|
||||
# IDE0055: All formatting rules
|
||||
dotnet_diagnostic.IDE0055.severity = suggestion
|
||||
|
||||
# IDE0059: Unnecessary assignment to a value
|
||||
dotnet_diagnostic.IDE0059.severity = warning
|
||||
|
||||
# IDE0060: Remove unused parameter
|
||||
dotnet_code_quality_unused_parameters = non_public
|
||||
dotnet_diagnostic.IDE0060.severity = warning
|
||||
|
||||
# IDE0062: Make local function static
|
||||
dotnet_diagnostic.IDE0062.severity = warning
|
||||
|
||||
# IDE0161: Convert to file-scoped namespace
|
||||
dotnet_diagnostic.IDE0161.severity = warning
|
||||
|
||||
# IDE0200: Lambda expression can be removed
|
||||
dotnet_diagnostic.IDE0200.severity = warning
|
||||
|
||||
# IDE2000: Disallow multiple blank lines
|
||||
dotnet_style_allow_multiple_blank_lines_experimental = false
|
||||
dotnet_diagnostic.IDE2000.severity = warning
|
||||
|
||||
[{test,tests,testassets,examples,perf,scripts,stress}/**.cs]
|
||||
# CA1018: Mark attributes with AttributeUsageAttribute
|
||||
dotnet_diagnostic.CA1018.severity = suggestion
|
||||
# CA1507: Use nameof to express symbol names
|
||||
dotnet_diagnostic.CA1507.severity = suggestion
|
||||
# CA1510: Use ArgumentNullException throw helper
|
||||
dotnet_diagnostic.CA1510.severity = suggestion
|
||||
# CA1511: Use ArgumentException throw helper
|
||||
dotnet_diagnostic.CA1511.severity = suggestion
|
||||
# CA1512: Use ArgumentOutOfRangeException throw helper
|
||||
dotnet_diagnostic.CA1512.severity = suggestion
|
||||
# CA1513: Use ObjectDisposedException throw helper
|
||||
dotnet_diagnostic.CA1513.severity = suggestion
|
||||
# CA1802: Use literals where appropriate
|
||||
dotnet_diagnostic.CA1802.severity = suggestion
|
||||
# CA1805: Do not initialize unnecessarily
|
||||
dotnet_diagnostic.CA1805.severity = suggestion
|
||||
# CA1810: Do not initialize unnecessarily
|
||||
dotnet_diagnostic.CA1810.severity = suggestion
|
||||
# CA1822: Make member static
|
||||
dotnet_diagnostic.CA1822.severity = suggestion
|
||||
# CA1823: Avoid zero-length array allocations
|
||||
dotnet_diagnostic.CA1825.severity = suggestion
|
||||
# CA1826: Do not use Enumerable methods on indexable collections. Instead use the collection directly
|
||||
dotnet_diagnostic.CA1826.severity = suggestion
|
||||
# CA1827: Do not use Count() or LongCount() when Any() can be used
|
||||
dotnet_diagnostic.CA1827.severity = suggestion
|
||||
# CA1829: Use Length/Count property instead of Count() when available
|
||||
dotnet_diagnostic.CA1829.severity = suggestion
|
||||
# CA1834: Consider using 'StringBuilder.Append(char)' when applicable
|
||||
dotnet_diagnostic.CA1834.severity = suggestion
|
||||
# CA1835: Prefer the 'Memory'-based overloads for 'ReadAsync' and 'WriteAsync'
|
||||
dotnet_diagnostic.CA1835.severity = suggestion
|
||||
# CA1837: Use 'Environment.ProcessId'
|
||||
dotnet_diagnostic.CA1837.severity = suggestion
|
||||
# CA1838: Avoid 'StringBuilder' parameters for P/Invokes
|
||||
dotnet_diagnostic.CA1838.severity = suggestion
|
||||
# CA1841: Prefer Dictionary.Contains methods
|
||||
dotnet_diagnostic.CA1841.severity = suggestion
|
||||
# CA1844: Provide memory-based overrides of async methods when subclassing 'Stream'
|
||||
dotnet_diagnostic.CA1844.severity = suggestion
|
||||
# CA1845: Use span-based 'string.Concat'
|
||||
dotnet_diagnostic.CA1845.severity = suggestion
|
||||
# CA1846: Prefer AsSpan over Substring
|
||||
dotnet_diagnostic.CA1846.severity = suggestion
|
||||
# CA1847: Use string.Contains(char) instead of string.Contains(string) with single characters
|
||||
dotnet_diagnostic.CA1847.severity = suggestion
|
||||
# CA1852: Seal internal types
|
||||
dotnet_diagnostic.CA1852.severity = suggestion
|
||||
# CA1854: Prefer the IDictionary.TryGetValue(TKey, out TValue) method
|
||||
dotnet_diagnostic.CA1854.severity = suggestion
|
||||
# CA1855: Prefer 'Clear' over 'Fill'
|
||||
dotnet_diagnostic.CA1855.severity = suggestion
|
||||
# CA1856: Incorrect usage of ConstantExpected attribute
|
||||
dotnet_diagnostic.CA1856.severity = suggestion
|
||||
# CA1857: A constant is expected for the parameter
|
||||
dotnet_diagnostic.CA1857.severity = suggestion
|
||||
# CA1858: Use 'StartsWith' instead of 'IndexOf'
|
||||
dotnet_diagnostic.CA1858.severity = suggestion
|
||||
# CA2007: Consider calling ConfigureAwait on the awaited task
|
||||
dotnet_diagnostic.CA2007.severity = suggestion
|
||||
# CA2008: Do not create tasks without passing a TaskScheduler
|
||||
dotnet_diagnostic.CA2008.severity = suggestion
|
||||
# CA2012: Use ValueTask correctly
|
||||
dotnet_diagnostic.CA2012.severity = suggestion
|
||||
# CA2249: Use string.Contains instead of string.IndexOf to improve readability.
|
||||
dotnet_diagnostic.CA2249.severity = suggestion
|
||||
# IDE0005: Remove unnecessary usings
|
||||
dotnet_diagnostic.IDE0005.severity = suggestion
|
||||
# IDE0020: Use pattern matching to avoid is check followed by a cast (with variable)
|
||||
dotnet_diagnostic.IDE0020.severity = suggestion
|
||||
# IDE0029: Use coalesce expression (non-nullable types)
|
||||
dotnet_diagnostic.IDE0029.severity = suggestion
|
||||
# IDE0030: Use coalesce expression (nullable types)
|
||||
dotnet_diagnostic.IDE0030.severity = suggestion
|
||||
# IDE0031: Use null propagation
|
||||
dotnet_diagnostic.IDE0031.severity = suggestion
|
||||
# IDE0038: Use pattern matching to avoid is check followed by a cast (without variable)
|
||||
dotnet_diagnostic.IDE0038.severity = suggestion
|
||||
# IDE0044: Make field readonly
|
||||
dotnet_diagnostic.IDE0044.severity = suggestion
|
||||
# IDE0051: Remove unused private members
|
||||
dotnet_diagnostic.IDE0051.severity = suggestion
|
||||
# IDE0059: Unnecessary assignment to a value
|
||||
dotnet_diagnostic.IDE0059.severity = suggestion
|
||||
# IDE0060: Remove unused parameters
|
||||
dotnet_diagnostic.IDE0060.severity = suggestion
|
||||
# IDE0062: Make local function static
|
||||
dotnet_diagnostic.IDE0062.severity = suggestion
|
||||
# IDE0200: Lambda expression can be removed
|
||||
dotnet_diagnostic.IDE0200.severity = suggestion
|
||||
|
||||
# CA2016: Forward the 'CancellationToken' parameter to methods that take one
|
||||
dotnet_diagnostic.CA2016.severity = suggestion
|
|
@ -0,0 +1,5 @@
|
|||
blank_issues_enabled: true
|
||||
contact_links:
|
||||
- name: Issue with Grpc.Core
|
||||
url: https://github.com/grpc/grpc/issues/new/choose
|
||||
about: Please open issues relating to Grpc.Core in grpc/grpc.
|
|
@ -0,0 +1,46 @@
|
|||
name: Build and Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ '**' ]
|
||||
schedule:
|
||||
- cron: 0 0 * * * # daily at 00:00
|
||||
|
||||
env:
|
||||
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
|
||||
|
||||
jobs:
|
||||
|
||||
build:
|
||||
name: Basic Tests
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install dotnet
|
||||
run: ./build/get-dotnet.sh
|
||||
|
||||
- name: Build and run tests
|
||||
run: ./build_and_test.sh
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: always()
|
||||
with:
|
||||
name: artifacts
|
||||
path: artifacts
|
||||
if-no-files-found: error
|
||||
|
||||
grpc_web:
|
||||
name: gRPC-Web Tests
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Run interop tests
|
||||
run: ./grpcweb_interoptests.sh
|
|
@ -34,7 +34,6 @@ launchSettings.json
|
|||
BenchmarkDotNet.Artifacts/
|
||||
BDN.Generated/
|
||||
binaries/
|
||||
global.json
|
||||
.vscode/
|
||||
*.binlog
|
||||
build/feed
|
||||
|
|
14
.travis.yml
14
.travis.yml
|
@ -1,14 +0,0 @@
|
|||
language: csharp
|
||||
sudo: required
|
||||
dist: xenial
|
||||
env:
|
||||
global:
|
||||
- DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
|
||||
mono: none
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
install:
|
||||
- ./build/get-dotnet.sh
|
||||
script:
|
||||
- ./build_and_test.sh
|
|
@ -1,6 +1,4 @@
|
|||
<Project>
|
||||
<Import Project="build\sources.props" />
|
||||
<Import Project="build\dependencies.props" />
|
||||
<Import Project="build\version.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
|
@ -12,12 +10,23 @@
|
|||
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)keys\Grpc.snk</AssemblyOriginatorKeyFile>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
<CheckEolTargetFramework>false</CheckEolTargetFramework>
|
||||
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
|
||||
|
||||
<!-- Don't make missing XML docs a fatal build error, but still surface so we have visibility into undocumented APIs. -->
|
||||
<WarningsNotAsErrors>$(WarningsNotAsErrors);CS1591</WarningsNotAsErrors>
|
||||
|
||||
<LangVersion>8.0</LangVersion>
|
||||
<!-- Disable warnings about AOT and trimming features on older targets, e.g. netstandard2.0.
|
||||
For now, continue to apply these features to these targets because some packages don't have a target that supports them -->
|
||||
<NoWarn>$(NoWarn);NETSDK1195;NETSDK1210</NoWarn>
|
||||
|
||||
<EmbedUntrackedSources>true</EmbedUntrackedSources>
|
||||
<LangVersion>12.0</LangVersion>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
|
||||
<!-- Some packages generate warnings when used on TFMs that are out of support (or almost out of support) -->
|
||||
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
@ -17,14 +17,38 @@
|
|||
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
|
||||
|
||||
<CodeAnalysisRuleset>$(MSBuildThisFileDirectory)Grpc.DotNet.ruleset</CodeAnalysisRuleset>
|
||||
|
||||
<IsTrimmable>true</IsTrimmable>
|
||||
<EnableAOTAnalyzer>true</EnableAOTAnalyzer>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- IsGrpcPublishedPackage is set in csproj so related config must be in targets file -->
|
||||
<ItemGroup Condition="'$(IsGrpcPublishedPackage)' == 'true'">
|
||||
<None Include="$(PackageIconFullPath)" Pack="true" PackagePath="\"/>
|
||||
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="$(MicrosoftCodeAnalysisFxCopAnalyzersPackageVersion)" PrivateAssets="All" />
|
||||
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="$(MicrosoftSourceLinkGitHubPackageVersion)" PrivateAssets="All" />
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" PrivateAssets="All" />
|
||||
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="$(MSBuildProjectName.EndsWith('Tests'))">
|
||||
<Using Include="NUnit.Framework.Legacy.ClassicAssert" Alias="Assert" />
|
||||
<Using Include="NUnit.Framework.Legacy" />
|
||||
<Using Include="NUnit.Framework" />
|
||||
</ItemGroup>
|
||||
|
||||
<!--
|
||||
Make a netstandard2.1 copy of the .net ILLinkPack to work around a trimming issue.
|
||||
See https://github.com/dotnet/linker/issues/3175
|
||||
TODO: Remove once .NET 8 + trimming + netstandard2.1 is fixed.
|
||||
-->
|
||||
<Target Name="_FixKnownILLinkPack"
|
||||
BeforeTargets="ProcessFrameworkReferences">
|
||||
<ItemGroup>
|
||||
<KnownILLinkPack Include="@(KnownILLinkPack)"
|
||||
Condition="'%(TargetFramework)' == 'net8.0'"
|
||||
TargetFramework="netstandard2.1"
|
||||
ILLinkPackVersion="%(KnownILLinkPack.ILLinkPackVersion)" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
|
|
|
@ -0,0 +1,88 @@
|
|||
<Project>
|
||||
<PropertyGroup>
|
||||
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
||||
<MicrosoftAspNetCoreAppPackageVersion>10.0.0-preview.6.25358.103</MicrosoftAspNetCoreAppPackageVersion>
|
||||
<MicrosoftAspNetCoreApp9PackageVersion>9.0.4</MicrosoftAspNetCoreApp9PackageVersion>
|
||||
<MicrosoftAspNetCoreApp8PackageVersion>8.0.15</MicrosoftAspNetCoreApp8PackageVersion>
|
||||
<GrpcDotNetPackageVersion>2.70.0</GrpcDotNetPackageVersion>
|
||||
<OpenTelemetryPackageVersion>1.6.0</OpenTelemetryPackageVersion>
|
||||
<OpenTelemetryIntergationPackageVersion>1.8.1</OpenTelemetryIntergationPackageVersion>
|
||||
<OpenTelemetryGrpcPackageVersion>1.8.0-beta.1</OpenTelemetryGrpcPackageVersion>
|
||||
<MicrosoftExtensionsPackageVersion>10.0.0-preview.6.25358.103</MicrosoftExtensionsPackageVersion>
|
||||
<MicrosoftExtensionsLtsPackageVersion>8.0.0</MicrosoftExtensionsLtsPackageVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<!-- ASP.NET Core -->
|
||||
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly" Version="$(MicrosoftAspNetCoreAppPackageVersion)" />
|
||||
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="$(MicrosoftAspNetCoreAppPackageVersion)" />
|
||||
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="$(MicrosoftAspNetCoreAppPackageVersion)" />
|
||||
<PackageVersion Include="Microsoft.AspNetCore.Authentication.Certificate" Version="$(MicrosoftAspNetCoreAppPackageVersion)" />
|
||||
<PackageVersion Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="$(MicrosoftAspNetCoreAppPackageVersion)" />
|
||||
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="$(MicrosoftAspNetCoreAppPackageVersion)" />
|
||||
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="$(MicrosoftAspNetCoreAppPackageVersion)" />
|
||||
<PackageVersion Include="Microsoft.AspNetCore.Grpc.JsonTranscoding" Version="$(MicrosoftAspNetCoreAppPackageVersion)" />
|
||||
<PackageVersion Include="Microsoft.AspNetCore.Grpc.Swagger" Version="0.8.0" />
|
||||
|
||||
<!-- Extensions -->
|
||||
<PackageVersion Include="Microsoft.Extensions.Http" Version="$(MicrosoftExtensionsPackageVersion)" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Logging" Version="$(MicrosoftExtensionsPackageVersion)" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="$(MicrosoftExtensionsPackageVersion)" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="$(MicrosoftExtensionsPackageVersion)" />
|
||||
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="$(MicrosoftExtensionsPackageVersion)" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="$(MicrosoftExtensionsPackageVersion)" />
|
||||
|
||||
<!-- gRPC -->
|
||||
<PackageVersion Include="Grpc.Tools" Version="2.71.0" />
|
||||
<PackageVersion Include="Grpc.Core" Version="2.46.6" />
|
||||
<PackageVersion Include="Grpc.Core.Api" Version="$(GrpcDotNetPackageVersion)"/>
|
||||
<PackageVersion Include="Grpc.Net.Client" Version="$(GrpcDotNetPackageVersion)" />
|
||||
<PackageVersion Include="Grpc.Net.Client.Web" Version="$(GrpcDotNetPackageVersion)" />
|
||||
<PackageVersion Include="Grpc.Net.ClientFactory" Version="$(GrpcDotNetPackageVersion)" />
|
||||
<PackageVersion Include="Grpc.AspNetCore" Version="$(GrpcDotNetPackageVersion)" />
|
||||
<PackageVersion Include="Grpc.AspNetCore.Server" Version="$(GrpcDotNetPackageVersion)" />
|
||||
<PackageVersion Include="Grpc.AspNetCore.Web" Version="$(GrpcDotNetPackageVersion)" />
|
||||
<PackageVersion Include="Grpc.Reflection" Version="$(GrpcDotNetPackageVersion)" />
|
||||
<PackageVersion Include="Grpc.AspNetCore.Server.Reflection" Version="$(GrpcDotNetPackageVersion)" />
|
||||
<PackageVersion Include="Grpc.HealthCheck" Version="$(GrpcDotNetPackageVersion)" />
|
||||
<PackageVersion Include="Grpc.AspNetCore.HealthChecks" Version="$(GrpcDotNetPackageVersion)" />
|
||||
<PackageVersion Include="Grpc.Auth" Version="$(GrpcDotNetPackageVersion)" />
|
||||
<PackageVersion Include="Grpc.StatusProto" Version="$(GrpcDotNetPackageVersion)" />
|
||||
|
||||
<!-- OpenTelemetry -->
|
||||
<PackageVersion Include="OpenTelemetry" Version="$(OpenTelemetryPackageVersion)" />
|
||||
<PackageVersion Include="OpenTelemetry.Exporter.Zipkin" Version="$(OpenTelemetryPackageVersion)" />
|
||||
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="$(OpenTelemetryPackageVersion)" />
|
||||
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="$(OpenTelemetryIntergationPackageVersion)" />
|
||||
<PackageVersion Include="OpenTelemetry.Instrumentation.GrpcNetClient" Version="$(OpenTelemetryGrpcPackageVersion)" />
|
||||
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="$(OpenTelemetryIntergationPackageVersion)" />
|
||||
|
||||
<!-- Other -->
|
||||
<PackageVersion Include="BenchmarkDotNet" Version="0.15.2" />
|
||||
<PackageVersion Include="CommandLineParser" Version="2.5.0" />
|
||||
<PackageVersion Include="Google.Api.CommonProtos" Version="2.16.0" />
|
||||
<PackageVersion Include="Google.Apis.Auth" Version="1.70.0" />
|
||||
<PackageVersion Include="Google.Protobuf" Version="3.31.1" />
|
||||
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
|
||||
<PackageVersion Include="Microsoft.Build.Locator" Version="1.5.5" />
|
||||
<PackageVersion Include="Microsoft.Build" Version="17.3.2" />
|
||||
<PackageVersion Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="10.0.0-preview.25358.103" />
|
||||
<PackageVersion Include="Microsoft.Crank.EventSources" Version="0.2.0-alpha.25128.2" />
|
||||
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
|
||||
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
|
||||
<PackageVersion Include="Microsoft.Win32.Registry" Version="4.6.0" />
|
||||
<PackageVersion Include="Moq" Version="4.20.70" />
|
||||
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageVersion Include="Nunit" Version="4.3.2" />
|
||||
<PackageVersion Include="NUnit3TestAdapter" Version="5.0.0" />
|
||||
<PackageVersion Include="protobuf-net.Grpc.AspNetCore" Version="1.0.140" />
|
||||
<PackageVersion Include="protobuf-net.Grpc" Version="1.0.140" />
|
||||
<PackageVersion Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
|
||||
<PackageVersion Include="System.CommandLine.Rendering" Version="0.4.0-alpha.22272.1" />
|
||||
<PackageVersion Include="System.Diagnostics.DiagnosticSource" Version="6.0.1" />
|
||||
<PackageVersion Include="System.Memory" Version="4.5.3" />
|
||||
<PackageVersion Include="System.Net.Http.WinHttpHandler" Version="8.0.3" />
|
||||
<PackageVersion Include="System.Security.Principal.Windows" Version="5.0.0" />
|
||||
<PackageVersion Include="System.Text.Json" Version="8.0.6" />
|
||||
<PackageVersion Include="System.Threading.Channels" Version="4.6.0" />
|
||||
</ItemGroup>
|
||||
</Project>
|
271
Grpc.DotNet.sln
271
Grpc.DotNet.sln
|
@ -1,271 +0,0 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.28527.54
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{8C62055F-8CD7-4859-9001-634D544DF2AE}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{CECC4AE8-9C4E-4727-939B-517CC2E58D65}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Grpc.AspNetCore.Server", "src\Grpc.AspNetCore.Server\Grpc.AspNetCore.Server.csproj", "{89ED416F-92F1-4425-9379-D4E76A285860}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Grpc.AspNetCore.Server.Tests", "test\Grpc.AspNetCore.Server.Tests\Grpc.AspNetCore.Server.Tests.csproj", "{278B1311-41BF-4345-947E-7B70E277FC3C}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Grpc.AspNetCore.FunctionalTests", "test\FunctionalTests\Grpc.AspNetCore.FunctionalTests.csproj", "{B190F61D-854C-4EE1-9532-B81AB3215F90}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "perf", "perf", "{4163E1B3-4D75-46B4-9107-9A158FD708FC}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "testassets", "testassets", "{59C7B1F0-EE4D-4098-8596-0ADDBC305234}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Proto", "Proto", "{BF1393D4-6099-4EF9-85BB-7EE6CBEB920C}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
testassets\Proto\any.proto = testassets\Proto\any.proto
|
||||
testassets\Proto\authorize.proto = testassets\Proto\authorize.proto
|
||||
testassets\Proto\chat.proto = testassets\Proto\chat.proto
|
||||
testassets\Proto\compression.proto = testassets\Proto\compression.proto
|
||||
testassets\Proto\count.proto = testassets\Proto\count.proto
|
||||
testassets\Proto\greet.proto = testassets\Proto\greet.proto
|
||||
testassets\Proto\lifetime.proto = testassets\Proto\lifetime.proto
|
||||
testassets\Proto\nested.proto = testassets\Proto\nested.proto
|
||||
examples\Proto\race.proto = examples\Proto\race.proto
|
||||
testassets\Proto\singleton.proto = testassets\Proto\singleton.proto
|
||||
testassets\Proto\streaming.proto = testassets\Proto\streaming.proto
|
||||
testassets\Proto\unimplemented.proto = testassets\Proto\unimplemented.proto
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FunctionalTestsWebsite", "testassets\FunctionalTestsWebsite\FunctionalTestsWebsite.csproj", "{7B95289B-4992-4C0D-B26F-8EC58F81FC96}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "benchmarkapps", "benchmarkapps", "{1B8B6117-CE39-4580-BAFA-D8026102767A}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BenchmarkClient", "perf\benchmarkapps\BenchmarkClient\BenchmarkClient.csproj", "{B10D4986-25D2-4414-B500-627D89505914}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{310E5783-455A-4D09-A7AE-39DC2AB09504}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
perf\benchmarkapps\Shared\benchmark_service.proto = perf\benchmarkapps\Shared\benchmark_service.proto
|
||||
perf\benchmarkapps\Shared\BenchmarkConfigurationHelpers.cs = perf\benchmarkapps\Shared\BenchmarkConfigurationHelpers.cs
|
||||
perf\benchmarkapps\Shared\BenchmarkServiceImpl.cs = perf\benchmarkapps\Shared\BenchmarkServiceImpl.cs
|
||||
perf\benchmarkapps\Shared\messages.proto = perf\benchmarkapps\Shared\messages.proto
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Grpc.AspNetCore.Microbenchmarks", "perf\Grpc.AspNetCore.Microbenchmarks\Grpc.AspNetCore.Microbenchmarks.csproj", "{98500D54-FC3F-4A42-B74D-51930C19B175}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InteropTestsWebsite", "testassets\InteropTestsWebsite\InteropTestsWebsite.csproj", "{A551D7B1-D75A-43F0-A8E3-BAEA5EDF616A}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BenchmarkWorkerWebsite", "testassets\BenchmarkWorkerWebsite\BenchmarkWorkerWebsite.csproj", "{C3D6C3BD-4E56-4B0F-88FD-4F2D68F0CD25}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Certs", "Certs", "{39320CA8-D8F0-45B6-B704-A04C16870226}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
perf\benchmarkapps\Shared\Certs\testCert.pfx = perf\benchmarkapps\Shared\Certs\testCert.pfx
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Grpc.AspNetCore.Server.Reflection", "src\Grpc.AspNetCore.Server.Reflection\Grpc.AspNetCore.Server.Reflection.csproj", "{55813F20-1269-4B19-B03E-7E4A90148F92}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InteropTestsClient", "testassets\InteropTestsClient\InteropTestsClient.csproj", "{291E5BA5-608D-406D-A2DB-389412D907F3}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Certs", "Certs", "{743F8EC2-004E-4640-B04F-5BAFDA8BF112}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "InteropTests", "InteropTests", "{50CF39FF-2644-4B5F-BE1A-B57487B9723B}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
testassets\Certs\InteropTests\ca.pem = testassets\Certs\InteropTests\ca.pem
|
||||
testassets\Certs\InteropTests\README.md = testassets\Certs\InteropTests\README.md
|
||||
testassets\Certs\InteropTests\server1.key = testassets\Certs\InteropTests\server1.key
|
||||
testassets\Certs\InteropTests\server1.pem = testassets\Certs\InteropTests\server1.pem
|
||||
testassets\Certs\InteropTests\server1.pfx = testassets\Certs\InteropTests\server1.pfx
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "grpc", "grpc", "{6DC078D2-8FB1-4685-B9BE-61F1C0ED8053}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "testing", "testing", "{88AC787E-603C-48C3-AEBA-D90F3E2142CA}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
testassets\Proto\grpc\testing\empty.proto = testassets\Proto\grpc\testing\empty.proto
|
||||
testassets\Proto\grpc\testing\messages.proto = testassets\Proto\grpc\testing\messages.proto
|
||||
testassets\Proto\grpc\testing\test.proto = testassets\Proto\grpc\testing\test.proto
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InteropTestsNativeServer", "testassets\InteropTestsNativeServer\InteropTestsNativeServer.csproj", "{D15CAEF6-0A5D-416E-B6F7-DE75C4B1D89B}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-grpc", "src\dotnet-grpc\dotnet-grpc.csproj", "{EBD5D978-1519-45ED-AC20-EC43C7FA552C}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-grpc.Tests", "test\dotnet-grpc.Tests\dotnet-grpc.Tests.csproj", "{265CD0AA-A1BD-40B8-A1E6-B3CB5F7591B8}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Grpc.AspNetCore.Server.ClientFactory", "src\Grpc.AspNetCore.Server.ClientFactory\Grpc.AspNetCore.Server.ClientFactory.csproj", "{BF9F5674-2BC3-446E-BBEA-3055A4A2B889}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Grpc.AspNetCore.Server.ClientFactory.Tests", "test\Grpc.AspNetCore.Server.ClientFactory.Tests\Grpc.AspNetCore.Server.ClientFactory.Tests.csproj", "{4306E048-9D81-44A8-8069-2C294289FC00}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Grpc.Net.Client", "src\Grpc.Net.Client\Grpc.Net.Client.csproj", "{095F2B46-16DC-4A2E-A075-A0373D902294}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Grpc.Net.Client.Tests", "test\Grpc.Net.Client.Tests\Grpc.Net.Client.Tests.csproj", "{7C299E2C-A5FE-439D-A346-2A676302BD04}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Grpc.Net.ClientFactory", "src\Grpc.Net.ClientFactory\Grpc.Net.ClientFactory.csproj", "{F68DBD76-196A-4F55-BBEB-97278655017F}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Grpc.Net.ClientFactory.Tests", "test\Grpc.Net.ClientFactory.Tests\Grpc.Net.ClientFactory.Tests.csproj", "{0C98BD64-8A57-46A1-B47B-EAF260DEE25A}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Grpc.AspNetCore", "src\Grpc.AspNetCore\Grpc.AspNetCore.csproj", "{F6CA82C9-85C6-4A5F-B892-4DF8A20B1C05}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Grpc.Net.Common", "src\Grpc.Net.Common\Grpc.Net.Common.csproj", "{69C50655-71EE-4E69-BC2C-ABCA568F6E76}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GrpcAspNetCoreServer", "perf\benchmarkapps\GrpcAspNetCoreServer\GrpcAspNetCoreServer.csproj", "{1D9AB69D-244C-4871-867E-DCEC52B552A4}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GrpcCoreServer", "perf\benchmarkapps\GrpcCoreServer\GrpcCoreServer.csproj", "{781111FC-8F3C-433E-BC96-D88ADAEE3064}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Grpc.Net.Client.Web", "src\Grpc.Net.Client.Web\Grpc.Net.Client.Web.csproj", "{429EB088-94FF-4F06-8E54-72157089C8C3}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Grpc.AspNetCore.Web", "src\Grpc.AspNetCore.Web\Grpc.AspNetCore.Web.csproj", "{778DB6EE-E5B2-4875-A209-40010B5A3E21}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Grpc.AspNetCore.HealthChecks", "src\Grpc.AspNetCore.HealthChecks\Grpc.AspNetCore.HealthChecks.csproj", "{39A9F2B5-2541-423E-83C9-46C7BFF53F41}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{89ED416F-92F1-4425-9379-D4E76A285860}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{89ED416F-92F1-4425-9379-D4E76A285860}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{89ED416F-92F1-4425-9379-D4E76A285860}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{89ED416F-92F1-4425-9379-D4E76A285860}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{278B1311-41BF-4345-947E-7B70E277FC3C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{278B1311-41BF-4345-947E-7B70E277FC3C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{278B1311-41BF-4345-947E-7B70E277FC3C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{278B1311-41BF-4345-947E-7B70E277FC3C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{B190F61D-854C-4EE1-9532-B81AB3215F90}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{B190F61D-854C-4EE1-9532-B81AB3215F90}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{B190F61D-854C-4EE1-9532-B81AB3215F90}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{B190F61D-854C-4EE1-9532-B81AB3215F90}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{7B95289B-4992-4C0D-B26F-8EC58F81FC96}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{7B95289B-4992-4C0D-B26F-8EC58F81FC96}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7B95289B-4992-4C0D-B26F-8EC58F81FC96}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{7B95289B-4992-4C0D-B26F-8EC58F81FC96}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{B10D4986-25D2-4414-B500-627D89505914}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{B10D4986-25D2-4414-B500-627D89505914}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{B10D4986-25D2-4414-B500-627D89505914}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{B10D4986-25D2-4414-B500-627D89505914}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{98500D54-FC3F-4A42-B74D-51930C19B175}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{98500D54-FC3F-4A42-B74D-51930C19B175}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{98500D54-FC3F-4A42-B74D-51930C19B175}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{98500D54-FC3F-4A42-B74D-51930C19B175}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{A551D7B1-D75A-43F0-A8E3-BAEA5EDF616A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A551D7B1-D75A-43F0-A8E3-BAEA5EDF616A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A551D7B1-D75A-43F0-A8E3-BAEA5EDF616A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A551D7B1-D75A-43F0-A8E3-BAEA5EDF616A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{C3D6C3BD-4E56-4B0F-88FD-4F2D68F0CD25}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{C3D6C3BD-4E56-4B0F-88FD-4F2D68F0CD25}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C3D6C3BD-4E56-4B0F-88FD-4F2D68F0CD25}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{C3D6C3BD-4E56-4B0F-88FD-4F2D68F0CD25}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{55813F20-1269-4B19-B03E-7E4A90148F92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{55813F20-1269-4B19-B03E-7E4A90148F92}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{55813F20-1269-4B19-B03E-7E4A90148F92}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{55813F20-1269-4B19-B03E-7E4A90148F92}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{291E5BA5-608D-406D-A2DB-389412D907F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{291E5BA5-608D-406D-A2DB-389412D907F3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{291E5BA5-608D-406D-A2DB-389412D907F3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{291E5BA5-608D-406D-A2DB-389412D907F3}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{D15CAEF6-0A5D-416E-B6F7-DE75C4B1D89B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D15CAEF6-0A5D-416E-B6F7-DE75C4B1D89B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D15CAEF6-0A5D-416E-B6F7-DE75C4B1D89B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D15CAEF6-0A5D-416E-B6F7-DE75C4B1D89B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{EBD5D978-1519-45ED-AC20-EC43C7FA552C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{EBD5D978-1519-45ED-AC20-EC43C7FA552C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{EBD5D978-1519-45ED-AC20-EC43C7FA552C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{EBD5D978-1519-45ED-AC20-EC43C7FA552C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{265CD0AA-A1BD-40B8-A1E6-B3CB5F7591B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{265CD0AA-A1BD-40B8-A1E6-B3CB5F7591B8}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{265CD0AA-A1BD-40B8-A1E6-B3CB5F7591B8}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{265CD0AA-A1BD-40B8-A1E6-B3CB5F7591B8}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{BF9F5674-2BC3-446E-BBEA-3055A4A2B889}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{BF9F5674-2BC3-446E-BBEA-3055A4A2B889}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{BF9F5674-2BC3-446E-BBEA-3055A4A2B889}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{BF9F5674-2BC3-446E-BBEA-3055A4A2B889}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{4306E048-9D81-44A8-8069-2C294289FC00}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{4306E048-9D81-44A8-8069-2C294289FC00}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{4306E048-9D81-44A8-8069-2C294289FC00}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{4306E048-9D81-44A8-8069-2C294289FC00}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{095F2B46-16DC-4A2E-A075-A0373D902294}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{095F2B46-16DC-4A2E-A075-A0373D902294}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{095F2B46-16DC-4A2E-A075-A0373D902294}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{095F2B46-16DC-4A2E-A075-A0373D902294}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{7C299E2C-A5FE-439D-A346-2A676302BD04}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{7C299E2C-A5FE-439D-A346-2A676302BD04}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7C299E2C-A5FE-439D-A346-2A676302BD04}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{7C299E2C-A5FE-439D-A346-2A676302BD04}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{F68DBD76-196A-4F55-BBEB-97278655017F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{F68DBD76-196A-4F55-BBEB-97278655017F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{F68DBD76-196A-4F55-BBEB-97278655017F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{F68DBD76-196A-4F55-BBEB-97278655017F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{0C98BD64-8A57-46A1-B47B-EAF260DEE25A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{0C98BD64-8A57-46A1-B47B-EAF260DEE25A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{0C98BD64-8A57-46A1-B47B-EAF260DEE25A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{0C98BD64-8A57-46A1-B47B-EAF260DEE25A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{F6CA82C9-85C6-4A5F-B892-4DF8A20B1C05}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{F6CA82C9-85C6-4A5F-B892-4DF8A20B1C05}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{F6CA82C9-85C6-4A5F-B892-4DF8A20B1C05}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{F6CA82C9-85C6-4A5F-B892-4DF8A20B1C05}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{69C50655-71EE-4E69-BC2C-ABCA568F6E76}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{69C50655-71EE-4E69-BC2C-ABCA568F6E76}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{69C50655-71EE-4E69-BC2C-ABCA568F6E76}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{69C50655-71EE-4E69-BC2C-ABCA568F6E76}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{1D9AB69D-244C-4871-867E-DCEC52B552A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{1D9AB69D-244C-4871-867E-DCEC52B552A4}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{1D9AB69D-244C-4871-867E-DCEC52B552A4}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1D9AB69D-244C-4871-867E-DCEC52B552A4}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{781111FC-8F3C-433E-BC96-D88ADAEE3064}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{781111FC-8F3C-433E-BC96-D88ADAEE3064}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{781111FC-8F3C-433E-BC96-D88ADAEE3064}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{781111FC-8F3C-433E-BC96-D88ADAEE3064}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{429EB088-94FF-4F06-8E54-72157089C8C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{429EB088-94FF-4F06-8E54-72157089C8C3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{429EB088-94FF-4F06-8E54-72157089C8C3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{429EB088-94FF-4F06-8E54-72157089C8C3}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{778DB6EE-E5B2-4875-A209-40010B5A3E21}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{778DB6EE-E5B2-4875-A209-40010B5A3E21}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{778DB6EE-E5B2-4875-A209-40010B5A3E21}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{778DB6EE-E5B2-4875-A209-40010B5A3E21}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{39A9F2B5-2541-423E-83C9-46C7BFF53F41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{39A9F2B5-2541-423E-83C9-46C7BFF53F41}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{39A9F2B5-2541-423E-83C9-46C7BFF53F41}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{39A9F2B5-2541-423E-83C9-46C7BFF53F41}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{89ED416F-92F1-4425-9379-D4E76A285860} = {8C62055F-8CD7-4859-9001-634D544DF2AE}
|
||||
{278B1311-41BF-4345-947E-7B70E277FC3C} = {CECC4AE8-9C4E-4727-939B-517CC2E58D65}
|
||||
{B190F61D-854C-4EE1-9532-B81AB3215F90} = {CECC4AE8-9C4E-4727-939B-517CC2E58D65}
|
||||
{59C7B1F0-EE4D-4098-8596-0ADDBC305234} = {CECC4AE8-9C4E-4727-939B-517CC2E58D65}
|
||||
{BF1393D4-6099-4EF9-85BB-7EE6CBEB920C} = {59C7B1F0-EE4D-4098-8596-0ADDBC305234}
|
||||
{7B95289B-4992-4C0D-B26F-8EC58F81FC96} = {59C7B1F0-EE4D-4098-8596-0ADDBC305234}
|
||||
{1B8B6117-CE39-4580-BAFA-D8026102767A} = {4163E1B3-4D75-46B4-9107-9A158FD708FC}
|
||||
{B10D4986-25D2-4414-B500-627D89505914} = {1B8B6117-CE39-4580-BAFA-D8026102767A}
|
||||
{310E5783-455A-4D09-A7AE-39DC2AB09504} = {1B8B6117-CE39-4580-BAFA-D8026102767A}
|
||||
{98500D54-FC3F-4A42-B74D-51930C19B175} = {4163E1B3-4D75-46B4-9107-9A158FD708FC}
|
||||
{A551D7B1-D75A-43F0-A8E3-BAEA5EDF616A} = {59C7B1F0-EE4D-4098-8596-0ADDBC305234}
|
||||
{C3D6C3BD-4E56-4B0F-88FD-4F2D68F0CD25} = {59C7B1F0-EE4D-4098-8596-0ADDBC305234}
|
||||
{39320CA8-D8F0-45B6-B704-A04C16870226} = {310E5783-455A-4D09-A7AE-39DC2AB09504}
|
||||
{55813F20-1269-4B19-B03E-7E4A90148F92} = {8C62055F-8CD7-4859-9001-634D544DF2AE}
|
||||
{291E5BA5-608D-406D-A2DB-389412D907F3} = {59C7B1F0-EE4D-4098-8596-0ADDBC305234}
|
||||
{743F8EC2-004E-4640-B04F-5BAFDA8BF112} = {59C7B1F0-EE4D-4098-8596-0ADDBC305234}
|
||||
{50CF39FF-2644-4B5F-BE1A-B57487B9723B} = {743F8EC2-004E-4640-B04F-5BAFDA8BF112}
|
||||
{6DC078D2-8FB1-4685-B9BE-61F1C0ED8053} = {BF1393D4-6099-4EF9-85BB-7EE6CBEB920C}
|
||||
{88AC787E-603C-48C3-AEBA-D90F3E2142CA} = {6DC078D2-8FB1-4685-B9BE-61F1C0ED8053}
|
||||
{D15CAEF6-0A5D-416E-B6F7-DE75C4B1D89B} = {59C7B1F0-EE4D-4098-8596-0ADDBC305234}
|
||||
{EBD5D978-1519-45ED-AC20-EC43C7FA552C} = {8C62055F-8CD7-4859-9001-634D544DF2AE}
|
||||
{265CD0AA-A1BD-40B8-A1E6-B3CB5F7591B8} = {CECC4AE8-9C4E-4727-939B-517CC2E58D65}
|
||||
{BF9F5674-2BC3-446E-BBEA-3055A4A2B889} = {8C62055F-8CD7-4859-9001-634D544DF2AE}
|
||||
{4306E048-9D81-44A8-8069-2C294289FC00} = {CECC4AE8-9C4E-4727-939B-517CC2E58D65}
|
||||
{095F2B46-16DC-4A2E-A075-A0373D902294} = {8C62055F-8CD7-4859-9001-634D544DF2AE}
|
||||
{7C299E2C-A5FE-439D-A346-2A676302BD04} = {CECC4AE8-9C4E-4727-939B-517CC2E58D65}
|
||||
{F68DBD76-196A-4F55-BBEB-97278655017F} = {8C62055F-8CD7-4859-9001-634D544DF2AE}
|
||||
{0C98BD64-8A57-46A1-B47B-EAF260DEE25A} = {CECC4AE8-9C4E-4727-939B-517CC2E58D65}
|
||||
{F6CA82C9-85C6-4A5F-B892-4DF8A20B1C05} = {8C62055F-8CD7-4859-9001-634D544DF2AE}
|
||||
{69C50655-71EE-4E69-BC2C-ABCA568F6E76} = {8C62055F-8CD7-4859-9001-634D544DF2AE}
|
||||
{1D9AB69D-244C-4871-867E-DCEC52B552A4} = {1B8B6117-CE39-4580-BAFA-D8026102767A}
|
||||
{781111FC-8F3C-433E-BC96-D88ADAEE3064} = {1B8B6117-CE39-4580-BAFA-D8026102767A}
|
||||
{429EB088-94FF-4F06-8E54-72157089C8C3} = {8C62055F-8CD7-4859-9001-634D544DF2AE}
|
||||
{778DB6EE-E5B2-4875-A209-40010B5A3E21} = {8C62055F-8CD7-4859-9001-634D544DF2AE}
|
||||
{39A9F2B5-2541-423E-83C9-46C7BFF53F41} = {8C62055F-8CD7-4859-9001-634D544DF2AE}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {CD5C2B19-49B4-480A-990C-36D98A719B07}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,90 @@
|
|||
<Solution>
|
||||
<Folder Name="/perf/">
|
||||
<Project Path="perf/Grpc.AspNetCore.Microbenchmarks/Grpc.AspNetCore.Microbenchmarks.csproj" />
|
||||
</Folder>
|
||||
<Folder Name="/perf/benchmarkapps/">
|
||||
<Project Path="perf/benchmarkapps/GrpcAspNetCoreServer/GrpcAspNetCoreServer.csproj" />
|
||||
<Project Path="perf/benchmarkapps/GrpcClient/GrpcClient.csproj" />
|
||||
<Project Path="perf/benchmarkapps/GrpcCoreServer/GrpcCoreServer.csproj" />
|
||||
<Project Path="perf/benchmarkapps/QpsWorker/QpsWorker.csproj" />
|
||||
</Folder>
|
||||
<Folder Name="/perf/benchmarkapps/Shared/">
|
||||
<File Path="perf/benchmarkapps/Shared/BenchmarkConfigurationHelpers.cs" />
|
||||
<File Path="perf/benchmarkapps/Shared/BenchmarkServiceImpl.cs" />
|
||||
<File Path="perf/benchmarkapps/Shared/benchmark_service.proto" />
|
||||
<File Path="perf/benchmarkapps/Shared/messages.proto" />
|
||||
</Folder>
|
||||
<Folder Name="/perf/benchmarkapps/Shared/Certs/">
|
||||
<File Path="perf/benchmarkapps/Shared/Certs/testCert.pfx" />
|
||||
</Folder>
|
||||
<Folder Name="/src/">
|
||||
<Project Path="src/dotnet-grpc/dotnet-grpc.csproj" />
|
||||
<Project Path="src/Grpc.AspNetCore.HealthChecks/Grpc.AspNetCore.HealthChecks.csproj" />
|
||||
<Project Path="src/Grpc.AspNetCore.Server.ClientFactory/Grpc.AspNetCore.Server.ClientFactory.csproj" />
|
||||
<Project Path="src/Grpc.AspNetCore.Server.Reflection/Grpc.AspNetCore.Server.Reflection.csproj" />
|
||||
<Project Path="src/Grpc.AspNetCore.Server/Grpc.AspNetCore.Server.csproj" />
|
||||
<Project Path="src/Grpc.AspNetCore.Web/Grpc.AspNetCore.Web.csproj" />
|
||||
<Project Path="src/Grpc.AspNetCore/Grpc.AspNetCore.csproj" />
|
||||
<Project Path="src/Grpc.Auth/Grpc.Auth.csproj" />
|
||||
<Project Path="src/Grpc.Core.Api/Grpc.Core.Api.csproj" />
|
||||
<Project Path="src/Grpc.HealthCheck/Grpc.HealthCheck.csproj" />
|
||||
<Project Path="src/Grpc.Net.Client.Web/Grpc.Net.Client.Web.csproj" />
|
||||
<Project Path="src/Grpc.Net.Client/Grpc.Net.Client.csproj" />
|
||||
<Project Path="src/Grpc.Net.ClientFactory/Grpc.Net.ClientFactory.csproj" />
|
||||
<Project Path="src/Grpc.Net.Common/Grpc.Net.Common.csproj" />
|
||||
<Project Path="src/Grpc.Reflection/Grpc.Reflection.csproj" />
|
||||
<Project Path="src/Grpc.StatusProto/Grpc.StatusProto.csproj" />
|
||||
</Folder>
|
||||
<Folder Name="/tests/">
|
||||
<Project Path="test/dotnet-grpc.Tests/dotnet-grpc.Tests.csproj" />
|
||||
<Project Path="test/FunctionalTests/Grpc.AspNetCore.FunctionalTests.csproj" />
|
||||
<Project Path="test/Grpc.AspNetCore.Server.ClientFactory.Tests/Grpc.AspNetCore.Server.ClientFactory.Tests.csproj" />
|
||||
<Project Path="test/Grpc.AspNetCore.Server.Tests/Grpc.AspNetCore.Server.Tests.csproj" />
|
||||
<Project Path="test/Grpc.Core.Api.Tests/Grpc.Core.Api.Tests.csproj" />
|
||||
<Project Path="test/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj" />
|
||||
<Project Path="test/Grpc.Net.Client.Tests/Grpc.Net.Client.Tests.csproj" />
|
||||
<Project Path="test/Grpc.Net.Client.Web.Tests/Grpc.Net.Client.Web.Tests.csproj" />
|
||||
<Project Path="test/Grpc.Net.ClientFactory.Tests/Grpc.Net.ClientFactory.Tests.csproj" />
|
||||
<Project Path="test/Grpc.Reflection.Tests/Grpc.Reflection.Tests.csproj" />
|
||||
<Project Path="test/Grpc.StatusProto.Tests/Grpc.StatusProto.Tests.csproj" />
|
||||
</Folder>
|
||||
<Folder Name="/tests/testassets/">
|
||||
<Project Path="testassets/BenchmarkWorkerWebsite/BenchmarkWorkerWebsite.csproj" />
|
||||
<Project Path="testassets/FunctionalTestsWebsite/FunctionalTestsWebsite.csproj" />
|
||||
<Project Path="testassets/InteropTestsClient/InteropTestsClient.csproj" />
|
||||
<Project Path="testassets/InteropTestsGrpcWebClient/InteropTestsGrpcWebClient.csproj" />
|
||||
<Project Path="testassets/InteropTestsGrpcWebWebsite/InteropTestsGrpcWebWebsite.csproj" />
|
||||
<Project Path="testassets/InteropTestsNativeServer/InteropTestsNativeServer.csproj" />
|
||||
<Project Path="testassets/InteropTestsWebsite/InteropTestsWebsite.csproj" />
|
||||
<Project Path="testassets/LinkerTestsClient/LinkerTestsClient.csproj" />
|
||||
<Project Path="testassets/LinkerTestsWebsite/LinkerTestsWebsite.csproj" />
|
||||
</Folder>
|
||||
<Folder Name="/tests/testassets/Certs/" />
|
||||
<Folder Name="/tests/testassets/Certs/InteropTests/">
|
||||
<File Path="testassets/Certs/InteropTests/ca.pem" />
|
||||
<File Path="testassets/Certs/InteropTests/README.md" />
|
||||
<File Path="testassets/Certs/InteropTests/server1.key" />
|
||||
<File Path="testassets/Certs/InteropTests/server1.pem" />
|
||||
<File Path="testassets/Certs/InteropTests/server1.pfx" />
|
||||
</Folder>
|
||||
<Folder Name="/tests/testassets/Proto/">
|
||||
<File Path="examples/Proto/race.proto" />
|
||||
<File Path="testassets/Proto/any.proto" />
|
||||
<File Path="testassets/Proto/authorize.proto" />
|
||||
<File Path="testassets/Proto/chat.proto" />
|
||||
<File Path="testassets/Proto/compression.proto" />
|
||||
<File Path="testassets/Proto/count.proto" />
|
||||
<File Path="testassets/Proto/greet.proto" />
|
||||
<File Path="testassets/Proto/lifetime.proto" />
|
||||
<File Path="testassets/Proto/nested.proto" />
|
||||
<File Path="testassets/Proto/singleton.proto" />
|
||||
<File Path="testassets/Proto/streaming.proto" />
|
||||
<File Path="testassets/Proto/unimplemented.proto" />
|
||||
</Folder>
|
||||
<Folder Name="/tests/testassets/Proto/grpc/" />
|
||||
<Folder Name="/tests/testassets/Proto/grpc/testing/">
|
||||
<File Path="testassets/Proto/grpc/testing/empty.proto" />
|
||||
<File Path="testassets/Proto/grpc/testing/messages.proto" />
|
||||
<File Path="testassets/Proto/grpc/testing/test.proto" />
|
||||
</Folder>
|
||||
</Solution>
|
|
@ -8,11 +8,17 @@ See [CONTRIBUTING.md](https://github.com/grpc/grpc-community/blob/master/CONTRIB
|
|||
for general contribution guidelines.
|
||||
|
||||
## Maintainers (in alphabetical order)
|
||||
- [anurse](https://github.com/anurse), Microsoft Corporation
|
||||
- [adityamandaleeka](https://github.com/adityamandaleeka), Microsoft Corporation
|
||||
- [amcasey](https://github.com/amcasey), Microsoft Corporation
|
||||
- [apolcyn](https://github.com/apolcyn), Google LLC
|
||||
- [benjaminpetit](https://github.com/benjaminpetit), Microsoft Corporation
|
||||
- [BrennanConroy](https://github.com/BrennanConroy), Microsoft Corporation
|
||||
- [davidfowl](https://github.com/davidfowl), Microsoft Corporation
|
||||
- [JamesNK](https://github.com/JamesNK), Microsoft Corporation
|
||||
- [jtattermusch](https://github.com/jtattermusch), Google LLC
|
||||
- [JunTaoLuo](https://github.com/JunTaoLuo), Microsoft Corporation
|
||||
- [mgravell](https://github.com/mgravell), Microsoft Corporation
|
||||
- [ReubenBond](https://github.com/ReubenBond), Microsoft Corporation
|
||||
- [stanley-cheung](https://github.com/stanley-cheung), Google LLC
|
||||
|
||||
## Emeritus Maintainers (in alphabetical order)
|
||||
- [jtattermusch](https://github.com/jtattermusch)
|
||||
- [JunTaoLuo](https://github.com/JunTaoLuo)
|
||||
|
|
23
README.md
23
README.md
|
@ -1,22 +1,23 @@
|
|||
# gRPC for .NET
|
||||
|
||||
## Available now on .NET Core 3.0!
|
||||
|
||||
gRPC is a modern, open source, high-performance remote procedure call (RPC) framework that can run anywhere. gRPC enables client and server applications to communicate transparently, and simplifies the building of connected systems.
|
||||
|
||||
gRPC functionality for .NET Core 3.0 includes:
|
||||
gRPC functionality for .NET Core 3.0 or later includes:
|
||||
|
||||
* [Grpc.AspNetCore](https://www.nuget.org/packages/Grpc.AspNetCore) – An ASP.NET Core framework for hosting gRPC services. gRPC on ASP.NET Core integrates with standard ASP.NET Core features like logging, dependency injection (DI), authentication and authorization.
|
||||
* [Grpc.Net.Client](https://www.nuget.org/packages/Grpc.Net.Client) – A gRPC client for .NET Core that builds upon the familiar `HttpClient`. The client uses new HTTP/2 functionality in .NET Core.
|
||||
* [Grpc.Net.ClientFactory](https://www.nuget.org/packages/Grpc.Net.ClientFactory) – gRPC client integration with `HttpClientFactory`. The client factory allows gRPC clients to be centrally configured and injected into your app with DI.
|
||||
|
||||
Please note that gRPC for .NET does not replace [gRPC for C#](https://github.com/grpc/grpc/tree/master/src/csharp) (gRPC C# API over native C-core binaries). These implementations coexist and share many of the same APIs to avoid lock-in. There are currently no plans for one implementation to replace the other one. gRPC for C# is the recommended solution for frameworks that gRPC for .NET does not support, such as .NET Framework.
|
||||
|
||||
For more information, see [An introduction to gRPC on .NET](https://docs.microsoft.com/aspnet/core/grpc/).
|
||||
|
||||
## gRPC for .NET is now the recommended implementation!
|
||||
|
||||
Starting from May 2021, gRPC for .NET is the recommended implemention of gRPC for C#. The original [gRPC for C#](https://github.com/grpc/grpc/tree/master/src/csharp) implementation (distributed as the `Grpc.Core` nuget package) is now in maintenance mode and will be deprecated in the future.
|
||||
See [blogpost](https://grpc.io/blog/grpc-csharp-future/) for more details.
|
||||
|
||||
## To start using gRPC for .NET
|
||||
|
||||
The best place to start using gRPC for .NET is the gRPC template that comes with .NET Core 3.0. Use the template to [create a gRPC service website and client](https://docs.microsoft.com/aspnet/core/tutorials/grpc/grpc-start).
|
||||
The best place to start using gRPC for .NET is the gRPC template that comes with .NET Core 3.0 or later. Use the template to [create a gRPC service website and client](https://docs.microsoft.com/aspnet/core/tutorials/grpc/grpc-start).
|
||||
|
||||
For additional examples of using gRPC in .NET refer to https://github.com/grpc/grpc-dotnet/tree/master/examples.
|
||||
|
||||
|
@ -61,14 +62,20 @@ startvs.cmd
|
|||
|
||||
To build from the command line:
|
||||
```
|
||||
dotnet build Grpc.DotNet.sln
|
||||
dotnet build Grpc.DotNet.slnx
|
||||
```
|
||||
|
||||
To run tests from the command line:
|
||||
```
|
||||
dotnet test Grpc.DotNet.sln
|
||||
dotnet test Grpc.DotNet.slnx
|
||||
```
|
||||
|
||||
### Alternative implementation using Code-First (external library)
|
||||
|
||||
An alternative way to use gRPC in .NET is to define the Protobuf contracts directly in C# using [protobuf-net](https://github.com/protobuf-net/protobuf-net.Grpc).
|
||||
|
||||
For more information, see the documentation on [learn.microsoft.com](https://learn.microsoft.com/aspnet/core/grpc/code-first) or the [protobuf-net.Grpc website](https://protobuf-net.github.io/protobuf-net.Grpc/).
|
||||
|
||||
## To contribute
|
||||
|
||||
Contributions are welcome!
|
||||
|
|
|
@ -1,27 +0,0 @@
|
|||
<Project>
|
||||
<PropertyGroup>
|
||||
<BenchmarkDotNetPackageVersion>0.11.3</BenchmarkDotNetPackageVersion>
|
||||
<CommandLineParserPackageVersion>2.3.0</CommandLineParserPackageVersion>
|
||||
<GoogleProtobufPackageVersion>3.11.4</GoogleProtobufPackageVersion>
|
||||
<GrpcDotNetPackageVersion>2.27.0-pre1</GrpcDotNetPackageVersion> <!-- Only use for example projects -->
|
||||
<GrpcPackageVersion>2.27.0</GrpcPackageVersion>
|
||||
<MicrosoftAspNetCorePackageVersion>3.1.2</MicrosoftAspNetCorePackageVersion>
|
||||
<MicrosoftAspNetCoreBlazorPackageVersion>3.2.0-preview1.20073.1</MicrosoftAspNetCoreBlazorPackageVersion>
|
||||
<MicrosoftBuildLocatorPackageVersion>1.2.2</MicrosoftBuildLocatorPackageVersion>
|
||||
<MicrosoftBuildPackageVersion>16.0.461</MicrosoftBuildPackageVersion>
|
||||
<MicrosoftCodeAnalysisFxCopAnalyzersPackageVersion>2.9.4</MicrosoftCodeAnalysisFxCopAnalyzersPackageVersion>
|
||||
<MicrosoftExtensionsPackageVersion>2.1.1</MicrosoftExtensionsPackageVersion>
|
||||
<MicrosoftExtensions30PackageVersion>3.0.0</MicrosoftExtensions30PackageVersion>
|
||||
<MicrosoftNETTestSdkPackageVersion>16.2.0</MicrosoftNETTestSdkPackageVersion>
|
||||
<MicrosoftSourceLinkGitHubPackageVersion>1.0.0-beta2-19367-01</MicrosoftSourceLinkGitHubPackageVersion>
|
||||
<MicrosoftWin32RegistryLinePackageVersion>4.6.0</MicrosoftWin32RegistryLinePackageVersion>
|
||||
<MoqPackageVersion>4.10.0</MoqPackageVersion>
|
||||
<NewtonsoftJsonPackageVersion>12.0.2</NewtonsoftJsonPackageVersion>
|
||||
<NunitPackageVersion>3.12.0</NunitPackageVersion>
|
||||
<Nunit3TestAdapterPackageVersion>3.13.0</Nunit3TestAdapterPackageVersion>
|
||||
<OpenTelemetryPackageVersion>0.2.0-alpha.100</OpenTelemetryPackageVersion>
|
||||
<SystemCommandLinePackageVersion>0.3.0-alpha.19405.1</SystemCommandLinePackageVersion>
|
||||
<SystemDiagnosticsDiagnosticSourcePackageVersion>4.5.1</SystemDiagnosticsDiagnosticSourcePackageVersion>
|
||||
<SystemSecurityPrincipalWindowsPackageVersion>4.6.0</SystemSecurityPrincipalWindowsPackageVersion>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -27,4 +27,11 @@ echo "Downloading install script: $install_script_url => $install_script_path"
|
|||
curl -sSL -o $install_script_path $install_script_url
|
||||
chmod +x $install_script_path
|
||||
|
||||
# Install .NET 8 SDK to run 8.0 test targets
|
||||
$install_script_path -v 8.0.412 -i $dotnet_install_path
|
||||
|
||||
# Install .NET 9 SDK to run 9.0 test targets
|
||||
$install_script_path -v 9.0.303 -i $dotnet_install_path
|
||||
|
||||
# Install .NET version specified by global.json
|
||||
$install_script_path -v $sdk_version -i $dotnet_install_path
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
<Project>
|
||||
<PropertyGroup Label="RestoreSources">
|
||||
<RestoreSources>
|
||||
$(RestoreSources);
|
||||
https://api.nuget.org/v3/index.json;
|
||||
https://dotnetfeed.blob.core.windows.net/aspnet-aspnetcore/index.json;
|
||||
https://dotnetfeed.blob.core.windows.net/aspnet-extensions/index.json;
|
||||
https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json;
|
||||
https://dotnet.myget.org/F/roslyn/api/v3/index.json;
|
||||
</RestoreSources>
|
||||
<RestoreSources Condition="Exists('$(MSBuildThisFileDirectory)feed')">
|
||||
$(RestoreSources);
|
||||
$(MSBuildThisFileDirectory)feed;
|
||||
</RestoreSources>
|
||||
<!-- The following is used to ingest nightly gRPC packages -->
|
||||
<RestoreSources>
|
||||
$(RestoreSources);
|
||||
https://grpc.jfrog.io/grpc/api/nuget/v3/grpc-nuget-dev;
|
||||
</RestoreSources>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -0,0 +1,32 @@
|
|||
#!/bin/bash
|
||||
# Copyright 2022 The gRPC Authors
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Update Grpc.Core.Api's VersionInfo.cs with versions from version.props
|
||||
|
||||
set -e
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
# retrieve version strings from version.props
|
||||
PACKAGE_VERSION=$(grep -o '<GrpcDotnetVersion>.*</GrpcDotnetVersion>' version.props | sed 's/<GrpcDotnetVersion>//' | sed 's/<\/GrpcDotnetVersion>//')
|
||||
ASSEMBLY_VERSION=$(grep -o '<GrpcDotnetAssemblyVersion>.*</GrpcDotnetAssemblyVersion>' version.props | sed 's/<GrpcDotnetAssemblyVersion>//' | sed 's/<\/GrpcDotnetAssemblyVersion>//')
|
||||
ASSEMBLY_FILE_VERSION=$(grep -o '<GrpcDotnetAssemblyFileVersion>.*</GrpcDotnetAssemblyFileVersion>' version.props | sed 's/<GrpcDotnetAssemblyFileVersion>//' | sed 's/<\/GrpcDotnetAssemblyFileVersion>//')
|
||||
|
||||
# update the contents of src/Grpc.Core.Api/VersionInfo.cs with the version strings
|
||||
sed -i "s/CurrentVersion = \".*\"/CurrentVersion = \"${PACKAGE_VERSION}\"/g" ../src/Grpc.Core.Api/VersionInfo.cs
|
||||
sed -i "s/CurrentAssemblyVersion = \".*\"/CurrentAssemblyVersion = \"${ASSEMBLY_VERSION}\"/g" ../src/Grpc.Core.Api/VersionInfo.cs
|
||||
sed -i "s/CurrentAssemblyFileVersion = \".*\"/CurrentAssemblyFileVersion = \"${ASSEMBLY_FILE_VERSION}\"/g" ../src/Grpc.Core.Api/VersionInfo.cs
|
||||
|
||||
echo "Updated version strings in src/Grpc.Core.Api/VersionInfo.cs"
|
|
@ -2,13 +2,13 @@
|
|||
<PropertyGroup>
|
||||
|
||||
<!-- package version of grpc-dotnet -->
|
||||
<GrpcDotnetVersion>2.28.0-dev</GrpcDotnetVersion>
|
||||
|
||||
<GrpcDotnetVersion>2.66.0-dev</GrpcDotnetVersion>
|
||||
|
||||
<!-- assembly version of grpc-dotnet -->
|
||||
<GrpcDotnetAssemblyVersion>2.0.0.0</GrpcDotnetAssemblyVersion>
|
||||
|
||||
<!-- file version of all grpc-dotnet -->
|
||||
<GrpcDotnetAssemblyFileVersion>2.28.0.0</GrpcDotnetAssemblyFileVersion>
|
||||
<GrpcDotnetAssemblyFileVersion>2.66.0.0</GrpcDotnetAssemblyFileVersion>
|
||||
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
|
|
@ -22,38 +22,21 @@ echo "Building solution"
|
|||
dotnet build -c Release
|
||||
|
||||
echo "Building examples"
|
||||
|
||||
example_solutions=( $( ls examples/**/*.sln ) )
|
||||
|
||||
example_solutions=( $( ls examples/**/*.slnx ) )
|
||||
for example_solution in "${example_solutions[@]}"
|
||||
do
|
||||
# dotnet build uses msbuild, and attempts to speed consecutive builds by reusing processes.
|
||||
# This can become a problem when multiple versions of Grpc.Tools are used between builds.
|
||||
# The different versions will conflict. Shutdown build processes between builds to avoid conflicts.
|
||||
# Will be fixed in msbuild 16.5 - https://github.com/microsoft/msbuild/issues/1754
|
||||
dotnet build-server shutdown
|
||||
|
||||
dotnet build $example_solution -c Release
|
||||
done
|
||||
|
||||
echo "Testing solution"
|
||||
|
||||
has_failures=false
|
||||
test_projects=( $( ls test/**/*Tests.csproj ) )
|
||||
|
||||
for test_project in "${test_projects[@]}"
|
||||
do
|
||||
# "dotnet test" is hanging when it writes to console for an unknown reason
|
||||
# Tracking issue at https://github.com/microsoft/vstest/issues/2080
|
||||
# Write test output to a text file and then write the text file to console as a workaround
|
||||
{
|
||||
dotnet test $test_project -c Release -v n --no-build &> ${test_project##*/}.log.txt &&
|
||||
echo "Success" &&
|
||||
cat ${test_project##*/}.log.txt
|
||||
} || {
|
||||
echo "Failure" &&
|
||||
cat ${test_project##*/}.log.txt &&
|
||||
exit 1
|
||||
}
|
||||
base_name=$(basename ${test_project%.*})
|
||||
dotnet test $test_project -c Release --no-build --logger "trx;LogFilePrefix=$base_name" --results-directory artifacts/test-results -- NUnit.ConsoleOut=0 || has_failures=true
|
||||
done
|
||||
|
||||
echo "Finished"
|
||||
if [ "$has_failures" = true ]; then
|
||||
exit 1
|
||||
fi
|
|
@ -11,23 +11,60 @@ This document summarizes the differences between the two available implementatio
|
|||
|
||||
## Criteria for choosing between grpc-dotnet and gRPC C#
|
||||
|
||||
One might choose one or the other implementation mostly for one of these reasons
|
||||
Starting from May 2021, gRPC for .NET is the recommended implemention of gRPC for C#.
|
||||
The original [gRPC C#](https://github.com/grpc/grpc/tree/master/src/csharp) implementation (distributed as the `Grpc.Core` nuget package) is now in maintenance mode and will be deprecated in the future.
|
||||
See [blogpost](https://grpc.io/blog/grpc-csharp-future/) for more details.
|
||||
|
||||
- avoid use of native code
|
||||
- ability to use .NET Core 3 and ASP.NET Core 3 (it's a brand new stack so not everyone will be able to use immediately)
|
||||
- want seamless integration with ASP.NET Core 3, dependency injection etc.
|
||||
- features available (see breakdown)
|
||||
- maturity level
|
||||
- performance (TODO: add data)
|
||||
Here are some key points in which the two implementation differ:
|
||||
|
||||
- grpc-dotnet avoids the use of native code (while Grpc.Core use the native C-core library internally)
|
||||
- grpc-dotnet requires a newer version of .NET (see the "Framework supported" section)
|
||||
- grpc-dotnet server integrates seamlessly ASP.NET Core (and allows e.g. dependency injection)
|
||||
- performance (while data we have data that seems to indicate that grpc-dotnet peforms at least as well as Grpc.Core, we strongly encourage to run your own benchmarks if performance matters for your application)
|
||||
- features available (see breakdown below)
|
||||
|
||||
## Frameworks supported
|
||||
|
||||
Grpc.Core supports a wide range of .NET versions, including some very old ones. A more detailed overview is [here]( https://github.com/grpc/grpc/tree/master/src/csharp#supported-platforms)
|
||||
|
||||
grpc-dotnet uses features only available in modern .NET releases. It doesn't support some older versions of .NET. A detailed summary of .NET versions supported by grpc-dotnet is [here](https://docs.microsoft.com/aspnet/core/grpc/supported-platforms). There is limited support for [grpc-dotnet client support on
|
||||
legacy .NET Framework](https://docs.microsoft.com/aspnet/core/grpc/netstandard).
|
||||
|
||||
## Comparison of supported features
|
||||
|
||||
Beyond the basic RPC functionality, there are a lot of gRPC features that may or may not be supported. The summary
|
||||
of supported features in both implementation is available in this section.
|
||||
|
||||
### Proxyless service mesh (XDS) support
|
||||
|
||||
While support for some of the Proxyless service mesh functionality comes "for free" by virtue of using the implementation from C-core native library, we don't officially support the proxyless service mesh functionality in C#.
|
||||
|
||||
In grpc-dotnet, we currently don't provide proxyless service mesh support, but it's something that we plan to add in the future. One of the first features we want to integrate is XDS load balancing.
|
||||
|
||||
### Load Balancing
|
||||
|
||||
grpc-dotnet and Grpc.Core provides basic client load balancing policies PICK_FIRST, ROUND_ROBIN.
|
||||
|
||||
Grpc.Core also has implemented two client-lookaside LB policies, but we don't recommend using them:
|
||||
|
||||
- grpclb - limited use externally as there's no official implementation of the LB policy. We don't recommend using it as it's been deprecated by the XDS load balancing.
|
||||
- XDS - Load balancing using the Envoy Universal Data Plane APIs (xDS). It does work in Grpc.Core (because it's implemented in C-core native library), but as noted above, we don't provide official support for the proxyless service mesh functionality in Grpc.Core.
|
||||
|
||||
Proxy load balancing is supported by both implementations because load balancing is done by a separate process (e.g. Envoy, ngingx etc.) that proxies the traffic.
|
||||
|
||||
grpc-dotnet allows user-provided custom load-balancing policies (= a plugin that provides the load-balancing logic).
|
||||
|
||||
Also see:
|
||||
|
||||
- https://learn.microsoft.com/aspnet/core/grpc/loadbalancing
|
||||
- https://github.com/grpc/grpc/blob/master/doc/load-balancing.md
|
||||
- https://github.com/grpc/grpc/blob/master/doc/naming.md
|
||||
- https://github.com/grpc/proposal/blob/master/A5-grpclb-in-dns.md
|
||||
- https://github.com/grpc/proposal/blob/master/A24-lb-policy-config.md
|
||||
|
||||
### Service config
|
||||
|
||||
Service config is currently only supported by Grpc.Core. Right now the feature is not that useful
|
||||
Service config is supported by grpc-dotnet and Grpc.Core. Right now, the feature is not that useful
|
||||
because support for service config encoded in DNS records hasn't been enabled yet by default.
|
||||
|
||||
Also see:
|
||||
|
@ -45,52 +82,36 @@ Grpc.Core: currently not supported.
|
|||
|
||||
Both implementations support client and server interceptors from Grpc.Core.Interceptors namespace. Interceptors operate at post-deserialization and pre-serialization level (no access to binary payloads).
|
||||
|
||||
In addition to gRPC-aware interceptors, grpc-dotnet also allows interception at a HTTP/2 level:
|
||||
In addition to gRPC-aware interceptors, grpc-dotnet also allows interception at an HTTP/2 level:
|
||||
|
||||
- Incoming gRPC HTTP/2 requests can be processed using [ASP.NET Core middleware](https://docs.microsoft.com/en-us/aspnet/core/fundamentals/middleware/).
|
||||
- Outgoing gRPC HTTP/2 requests can be processed using [HttpClient HttpMessageHandlers](https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpmessagehandler).
|
||||
|
||||
### Load Balancing
|
||||
|
||||
Grpc.Core provides basic client load balancing policies PICK_FIRST, ROUND_ROBIN and client-lookaside LB policies:
|
||||
|
||||
- grpclb - limited use externally as there's no official implementation of the LB policy
|
||||
- XDS - Load balancing using the Envoy Universal Data Plane APIs (xDS). Currently this is work in progress but once ready, it will be the LB of choice for lookaside LB.
|
||||
|
||||
grpc-dotnet currently doesn't provide any loadbalancing policies. It is likely that to support the XDS loadbalancing policy, features will need to be added to .NET HttpClient.
|
||||
|
||||
Proxy loadbalancing is supported by both implementations because loadbalancing is done by a separate process (e.g. Envoy, ngingx etc.) that proxies the traffic.
|
||||
|
||||
None of the implementations currently allow user-provided custom loadbalancing policies (= a plugin that provides the loadbalancing logic).
|
||||
|
||||
- https://github.com/grpc/grpc/blob/master/doc/load-balancing.md
|
||||
- https://github.com/grpc/grpc/blob/master/doc/naming.md
|
||||
- https://github.com/grpc/proposal/blob/master/A5-grpclb-in-dns.md
|
||||
- https://github.com/grpc/proposal/blob/master/A24-lb-policy-config.md
|
||||
|
||||
### Transport support
|
||||
|
||||
Both implementations fully support gRPC over HTTP/2 in both TLS and plaintext.
|
||||
|
||||
Grpc.Core gets support for other transports supported by C-Core for free. Some (minor) integration work might be required to actually use these transports with gRPC C#.
|
||||
|
||||
grpc-dotnet only supports the default transport.
|
||||
grpc-dotnet supports other transports in .NET 5 or later. For example, grpc-dotnet [supports interprocess communication (IPC)](https://learn.microsoft.com/aspnet/core/grpc/interprocess) using named pipes and Unix domain sockets.
|
||||
|
||||
Notes:
|
||||
|
||||
- Grpc.Core allows connections over UDS socket (both server and client) on Unix systems. It doesn't support named pipes on windows.
|
||||
- Grpc.Core supports additional "transports" like ALTS and cfstream thanks to being build on top of C-core.
|
||||
- Grpc.Core could provide an inprocess transport support but currently this functionality is not exposed in C# API.
|
||||
- grpc-dotnet support for TLS is platform dependent. TLS is fully supported on Windows and Linux, but doesn't work on MacOS.
|
||||
- grpc-dotnet support UDS socket on the server-side (On Unix systems, but also on [Windows](https://devblogs.microsoft.com/commandline/af_unix-comes-to-windows/))
|
||||
- grpc-dotnet support for TLS is platform dependent. TLS is fully supported on Windows and Linux. There is limited support for servers hosted on MacOS prior to .NET 8.
|
||||
|
||||
### Retries / Request Hedging
|
||||
|
||||
Grpc.Core: implementation in C-core in progress, but no ETA yet
|
||||
|
||||
grpc-dotnet: not implemented
|
||||
grpc-dotnet: Retries and hedging are fully supported.
|
||||
|
||||
https://github.com/grpc/proposal/blob/master/A6-client-retries.md,
|
||||
Also see:
|
||||
|
||||
- https://learn.microsoft.com/aspnet/core/grpc/retries
|
||||
- https://github.com/grpc/proposal/blob/master/A6-client-retries.md
|
||||
|
||||
### Channelz
|
||||
|
||||
|
@ -112,7 +133,7 @@ https://github.com/grpc/grpc/blob/master/doc/binary-logging.md
|
|||
|
||||
Grpc.Core: supported (algorithms: `gzip`, `deflate`)
|
||||
|
||||
grpc-dotnet: supported (algorithms: `gzip`), also provides public API to provide custom compression algorithm.
|
||||
grpc-dotnet: supported (algorithms: `gzip`, `deflate`), also provides public API to provide custom compression algorithm.
|
||||
|
||||
Performance implications of using compression in both implementations haven't been measured. Compression functionality is offered mostly to comply with the spec.
|
||||
|
||||
|
@ -123,7 +144,7 @@ https://github.com/grpc/grpc/blob/master/doc/compression_cookbook.md
|
|||
|
||||
Grpc.Core: supported (exposed publicly on Channel), provided by C-Core
|
||||
|
||||
grpc-dotnet: not supported (to provide support, changes to .NET HttpClient are needed, so adding support is non-trivial).
|
||||
grpc-dotnet: Supported on .NET 5 or later
|
||||
|
||||
https://github.com/grpc/grpc/blob/master/doc/connectivity-semantics-and-api.md
|
||||
|
||||
|
@ -147,7 +168,7 @@ https://github.com/grpc/grpc/blob/master/doc/keepalive.md
|
|||
|
||||
Grpc.Core: supported, provided by C-core
|
||||
|
||||
grpc-dotnet: not supported (implementing the wait_for_ready flag requires supporting channel connectivity first).
|
||||
grpc-dotnet: Supported on .NET 5 or later
|
||||
|
||||
https://github.com/grpc/grpc/blob/master/doc/wait-for-ready.md
|
||||
|
||||
|
@ -155,7 +176,7 @@ https://github.com/grpc/grpc/blob/master/doc/wait-for-ready.md
|
|||
|
||||
Grpc.Core: conforms with the spec thanks to the C-core dependency. It is currently not possible to provide custom C# resolvers via resolver API (the APIs are in C core and aren't exposed in the C# layer).
|
||||
|
||||
grpc-dotnet: only resolves basic DNS names. No API to provide a custom resolver.
|
||||
grpc-dotnet: Resolving is fully supported on .NET 5 or later. grpc-dotnet also provides an [API to write custom resolvers](https://learn.microsoft.com/aspnet/core/grpc/loadbalancingwrite-custom-resolvers-and-load-balancers).
|
||||
|
||||
https://github.com/grpc/grpc/blob/master/doc/naming.md
|
||||
|
||||
|
@ -165,7 +186,7 @@ grpc-dotnet allows port-sharing: serving both gRPC and non-gRPC traffic by the s
|
|||
|
||||
## Add-on Features
|
||||
|
||||
Features that don't necessarily require changes to implementation's internals. They usually come as a separate opt-in nuget package.
|
||||
Features that don't necessarily require changes to the implementation's internals. They usually come as a separate opt-in nuget package.
|
||||
|
||||
### Addon: Server Reflection
|
||||
Grpc.Core: supported via Grpc.Reflection nuget package
|
||||
|
@ -197,4 +218,22 @@ grpc-dotnet supports integration with `HttpClientFactory` via the Grpc.Net.Clien
|
|||
- Reuse of channel instances.
|
||||
- Automatic propagation of cancellation and deadline when used in a `Grpc.AspNetCore` hosted gRPC service.
|
||||
|
||||
https://docs.microsoft.com/en-us/aspnet/core/grpc/clientfactory
|
||||
### Addon: gRPC JSON transcoding
|
||||
|
||||
grpc-dotnet supports providing a RESTful JSON API using [gRPC JSON transcoding](https://learn.microsoft.com/aspnet/core/grpc/json-transcoding).
|
||||
|
||||
gRPC JSON transcoding is an extension for ASP.NET Core that creates RESTful JSON APIs for gRPC services. Once configured, transcoding allows apps to call gRPC services with familiar HTTP concepts:
|
||||
|
||||
- HTTP verbs
|
||||
- URL parameter binding
|
||||
- JSON requests/responses
|
||||
|
||||
gRPC can still be used to call services.
|
||||
|
||||
### Addon: gRPC-Web
|
||||
|
||||
grpc-dotnet supports the [gRPC-Web protocol](https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-WEB.md).
|
||||
|
||||
gRPC-Web allows browser JavaScript and Blazor apps to call gRPC services. It's not possible to call a gRPC service over HTTP/2 from a browser-based app. gRPC services hosted in ASP.NET Core can be configured to support gRPC-Web alongside gRPC over HTTP/2.
|
||||
|
||||
https://learn.microsoft.com/aspnet/core/grpc/grpcweb
|
||||
|
|
|
@ -10,8 +10,9 @@ release that the new release depends on.
|
|||
## Releasing a new version of grpc-dotnet (every 6 weeks)
|
||||
|
||||
- Before cutting the release branch
|
||||
- If needed, on the master branch update the `<GrpcPackageVersion>` dependency version in [dependencies.props](https://github.com/grpc/grpc-dotnet/blob/master/build/dependencies.props)
|
||||
to the latest pre-release of `Grpc.Core.Api` (that was just released as part of the grpc/grpc release process)
|
||||
- If needed, on the master branch update the `Grpc.Tools` and `Grpc.Core` dependency versions in [Directory.Packages.props](https://github.com/grpc/grpc-dotnet/blob/master/Directory.Packages.props)
|
||||
to the latest pre-release of `Grpc.Tools` or `Grpc.Core` (that was released as part of the grpc/grpc release process)
|
||||
|
||||
- Make sure that any patches/bugfixes from the last released branch have been applied to the master branch as well.
|
||||
|
||||
- Cut the release branch from master branch (the branch format is `v2.25.x`, `v2.26.x`, ...).
|
||||
|
@ -19,22 +20,27 @@ release that the new release depends on.
|
|||
|
||||
- On the release branch, replace the `-dev` suffix by `-pre1` under `<GrpcDotnetVersion>` version release number in [version.props](https://github.com/grpc/grpc-dotnet/blob/master/build/version.props)
|
||||
to prepare for building the pre-release nugets.
|
||||
Also check that the minor version number matches the branch name.
|
||||
- You'll also need to update `CurrentVersion` field in `Grpc.Core.Api`'s [VersionInfo.cs](https://github.com/grpc/grpc-dotnet/blob/6bbbf3627797ad8f787eced10b0e548cfd9ece15/src/Grpc.Core.Api/VersionInfo.cs#L44) to match the version number (otherwise tests will fail).
|
||||
- Also check that the minor version number matches the branch name.
|
||||
|
||||
- Build the signed nuget packages and push them to nuget.org (internal process). **These are the pre-release packages.**
|
||||
|
||||
- Create a new release and tag in https://github.com/grpc/grpc-dotnet/releases (by creating the tag from the current release branch).
|
||||
Mark the release as "pre-release" in the github UI. Fill in the release notes.
|
||||
|
||||
- Wait for the stable release of `Grpc.Core.Api` (as scheduled by the release schedule), keep checking the issue tracker for problems with the new grpc-dotnet pre-release packages.
|
||||
- Wait for the stable release of `Grpc.Tools` from the `grpc/grpc` repository (as scheduled by the release schedule), keep checking the issue tracker for problems with the new grpc-dotnet pre-release packages.
|
||||
If problems are discovered and they need to be fixed, the release manager might choose to release more pre-releases (`-pre2`, `-pre3`, ...) before deciding to release as stable.
|
||||
|
||||
- **Make sure at least 7 days have elapsed since the last pre-release before proceeding with the stable release**, to give users enough time to test the prerelease nugets and discover potential issues. This is to decrease the likelyhood of pushing a bad stable release.
|
||||
|
||||
- Once stable version of `Grpc.Core.Api` is pushed, remove `-pre1` suffix of the `<GrpcDotnetVersion>` version release number in [version.props](https://github.com/grpc/grpc-dotnet/blob/master/build/version.props) to prepare for the stable release.
|
||||
- Once stable version of `Grpc.Tools` is pushed, remove `-pre1` suffix of the `<GrpcDotnetVersion>` version release number in [version.props](https://github.com/grpc/grpc-dotnet/blob/master/build/version.props) to prepare for the stable release.
|
||||
|
||||
- Update `CurrentVersion` field in `Grpc.Core.Api`'s [VersionInfo.cs](https://github.com/grpc/grpc-dotnet/blob/6bbbf3627797ad8f787eced10b0e548cfd9ece15/src/Grpc.Core.Api/VersionInfo.cs#L44) to match the version number (otherwise tests will fail).
|
||||
|
||||
- Build the signed nuget packages and push them to nuget.org (internal process). **These are the stable grpc-dotnet packages.**
|
||||
|
||||
- Create a new release and tag in https://github.com/grpc/grpc-dotnet/releases (by creating the tag from the current release branch).
|
||||
This is the stable release. Fill in the release notes.
|
||||
This is the stable release. Fill in the release notes and list changes since the previous _stable_ version.
|
||||
|
||||
### After the release
|
||||
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
services:
|
||||
grpcweb-server:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: ./testassets/InteropTestsWebsite/Dockerfile
|
||||
image: grpc-dotnet/grpcweb-server
|
||||
ports:
|
||||
- "8080:80"
|
||||
grpcweb-client:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: ./testassets/InteropTestsGrpcWebWebsite/Dockerfile
|
||||
image: grpc-dotnet/grpcweb-client
|
||||
ports:
|
||||
- "8081:80"
|
|
@ -1,31 +0,0 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.29230.61
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Server", "Server\Server.csproj", "{534AC5F8-2DF2-40BD-87A5-B3D8310118C4}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Client", "Client\Client.csproj", "{48A1D3BC-A14B-436A-8822-6DE2BEF8B747}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{534AC5F8-2DF2-40BD-87A5-B3D8310118C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{534AC5F8-2DF2-40BD-87A5-B3D8310118C4}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{534AC5F8-2DF2-40BD-87A5-B3D8310118C4}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{534AC5F8-2DF2-40BD-87A5-B3D8310118C4}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{48A1D3BC-A14B-436A-8822-6DE2BEF8B747}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{48A1D3BC-A14B-436A-8822-6DE2BEF8B747}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{48A1D3BC-A14B-436A-8822-6DE2BEF8B747}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{48A1D3BC-A14B-436A-8822-6DE2BEF8B747}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {D22B3129-3BFB-41FA-9FCE-E45EBEF8C2DD}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,4 @@
|
|||
<Solution>
|
||||
<Project Path="Client/Client.csproj" />
|
||||
<Project Path="Server/Server.csproj" />
|
||||
</Solution>
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -10,9 +10,9 @@
|
|||
<Protobuf Include="..\Proto\greet.proto" GrpcServices="None" Link="Protos\greet.proto"/>
|
||||
<Protobuf Include="..\Proto\count.proto" GrpcServices="None" Link="Protos\count.proto"/>
|
||||
|
||||
<PackageReference Include="Google.Protobuf" Version="$(GoogleProtobufPackageVersion)" />
|
||||
<PackageReference Include="Grpc.Net.Client" Version="$(GrpcDotNetPackageVersion)" />
|
||||
<PackageReference Include="Grpc.Tools" Version="$(GrpcPackageVersion)" PrivateAssets="All" />
|
||||
<PackageReference Include="Google.Protobuf" />
|
||||
<PackageReference Include="Grpc.Net.Client" />
|
||||
<PackageReference Include="Grpc.Tools" PrivateAssets="All" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
@ -16,72 +16,54 @@
|
|||
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Aggregate;
|
||||
using Count;
|
||||
using Greet;
|
||||
using Grpc.Core;
|
||||
using Grpc.Net.Client;
|
||||
|
||||
namespace Client
|
||||
using var channel = GrpcChannel.ForAddress("https://localhost:5001");
|
||||
var client = new Aggregator.AggregatorClient(channel);
|
||||
|
||||
await ServerStreamingCallExample(client);
|
||||
|
||||
await ClientStreamingCallExample(client);
|
||||
|
||||
Console.WriteLine("Press any key to exit...");
|
||||
Console.ReadKey();
|
||||
|
||||
static async Task ServerStreamingCallExample(Aggregator.AggregatorClient client)
|
||||
{
|
||||
public class Program
|
||||
var cts = new CancellationTokenSource();
|
||||
cts.CancelAfter(TimeSpan.FromSeconds(3.5));
|
||||
|
||||
using var call = client.SayHellos(new HelloRequest { Name = "AggregatorClient" }, cancellationToken: cts.Token);
|
||||
try
|
||||
{
|
||||
static Random RNG = new Random();
|
||||
|
||||
static async Task Main(string[] args)
|
||||
await foreach (var message in call.ResponseStream.ReadAllAsync())
|
||||
{
|
||||
var channel = GrpcChannel.ForAddress("https://localhost:5001");
|
||||
var client = new Aggregator.AggregatorClient(channel);
|
||||
|
||||
await ServerStreamingCallExample(client);
|
||||
|
||||
await ClientStreamingCallExample(client);
|
||||
|
||||
Console.WriteLine("Press any key to exit...");
|
||||
Console.ReadKey();
|
||||
}
|
||||
|
||||
private static async Task ServerStreamingCallExample(Aggregator.AggregatorClient client)
|
||||
{
|
||||
var cts = new CancellationTokenSource();
|
||||
cts.CancelAfter(TimeSpan.FromSeconds(3.5));
|
||||
|
||||
using (var replies = client.SayHellos(new HelloRequest { Name = "AggregatorClient" }, cancellationToken: cts.Token))
|
||||
{
|
||||
try
|
||||
{
|
||||
await foreach (var message in replies.ResponseStream.ReadAllAsync())
|
||||
{
|
||||
Console.WriteLine("Greeting: " + message.Message);
|
||||
}
|
||||
}
|
||||
catch (RpcException ex) when (ex.StatusCode == StatusCode.Cancelled)
|
||||
{
|
||||
Console.WriteLine("Stream cancelled.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static async Task ClientStreamingCallExample(Aggregator.AggregatorClient client)
|
||||
{
|
||||
using (var call = client.AccumulateCount())
|
||||
{
|
||||
for (var i = 0; i < 3; i++)
|
||||
{
|
||||
var count = RNG.Next(5);
|
||||
Console.WriteLine($"Accumulating with {count}");
|
||||
await call.RequestStream.WriteAsync(new CounterRequest { Count = count });
|
||||
await Task.Delay(2000);
|
||||
}
|
||||
|
||||
await call.RequestStream.CompleteAsync();
|
||||
|
||||
var response = await call;
|
||||
Console.WriteLine($"Count: {response.Count}");
|
||||
}
|
||||
Console.WriteLine("Greeting: " + message.Message);
|
||||
}
|
||||
}
|
||||
catch (RpcException ex) when (ex.StatusCode == StatusCode.Cancelled)
|
||||
{
|
||||
Console.WriteLine("Stream cancelled.");
|
||||
}
|
||||
}
|
||||
|
||||
static async Task ClientStreamingCallExample(Aggregator.AggregatorClient client)
|
||||
{
|
||||
using var call = client.AccumulateCount();
|
||||
for (var i = 0; i < 3; i++)
|
||||
{
|
||||
var count = Random.Shared.Next(5);
|
||||
Console.WriteLine($"Accumulating with {count}");
|
||||
await call.RequestStream.WriteAsync(new CounterRequest { Count = count });
|
||||
await Task.Delay(2000);
|
||||
}
|
||||
|
||||
await call.RequestStream.CompleteAsync();
|
||||
|
||||
var response = await call;
|
||||
Console.WriteLine($"Count: {response.Count}");
|
||||
}
|
||||
|
|
|
@ -16,23 +16,59 @@
|
|||
|
||||
#endregion
|
||||
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Count;
|
||||
using Greet;
|
||||
using OpenTelemetry.Resources;
|
||||
using OpenTelemetry.Trace;
|
||||
using Server;
|
||||
|
||||
namespace Server
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
builder.Services.AddGrpc();
|
||||
builder.Services.AddSingleton<IncrementingCounter>();
|
||||
|
||||
if (bool.TryParse(builder.Configuration["EnableOpenTelemetry"], out var enableOpenTelemetry) && enableOpenTelemetry)
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
builder.Services.AddOpenTelemetry()
|
||||
.WithTracing(tracing =>
|
||||
{
|
||||
CreateHostBuilder(args).Build().Run();
|
||||
}
|
||||
tracing.SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("aggregator"));
|
||||
|
||||
public static IHostBuilder CreateHostBuilder(string[] args) =>
|
||||
Host.CreateDefaultBuilder(args)
|
||||
.ConfigureWebHostDefaults(webBuilder =>
|
||||
{
|
||||
webBuilder.UseStartup<Startup>();
|
||||
});
|
||||
}
|
||||
if (builder.Environment.IsDevelopment())
|
||||
{
|
||||
// We want to view all traces in development
|
||||
tracing.SetSampler(new AlwaysOnSampler());
|
||||
}
|
||||
|
||||
tracing.AddAspNetCoreInstrumentation()
|
||||
.AddGrpcClientInstrumentation()
|
||||
.AddHttpClientInstrumentation();
|
||||
|
||||
tracing.AddZipkinExporter();
|
||||
});
|
||||
}
|
||||
|
||||
// These clients will call back to the server
|
||||
builder.Services
|
||||
.AddGrpcClient<Greeter.GreeterClient>((s, o) => { o.Address = GetCurrentAddress(s); })
|
||||
.EnableCallContextPropagation();
|
||||
builder.Services
|
||||
.AddGrpcClient<Counter.CounterClient>((s, o) => { o.Address = GetCurrentAddress(s); })
|
||||
.EnableCallContextPropagation();
|
||||
|
||||
var app = builder.Build();
|
||||
app.MapGrpcService<GreeterService>();
|
||||
app.MapGrpcService<CounterService>();
|
||||
app.MapGrpcService<AggregatorService>();
|
||||
app.Run();
|
||||
|
||||
static Uri GetCurrentAddress(IServiceProvider serviceProvider)
|
||||
{
|
||||
// Get the address of the current server from the request
|
||||
var context = serviceProvider.GetRequiredService<IHttpContextAccessor>()?.HttpContext;
|
||||
if (context == null)
|
||||
{
|
||||
throw new InvalidOperationException("Could not get HttpContext.");
|
||||
}
|
||||
|
||||
return new Uri($"{context.Request.Scheme}://{context.Request.Host.Value}");
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -9,12 +9,13 @@
|
|||
<Protobuf Include="..\Proto\greet.proto" GrpcServices="Both" Link="Protos\greet.proto" />
|
||||
<Protobuf Include="..\Proto\count.proto" GrpcServices="Both" Link="Protos\count.proto" />
|
||||
|
||||
<PackageReference Include="Grpc.AspNetCore" Version="$(GrpcDotNetPackageVersion)" />
|
||||
<PackageReference Include="Grpc.AspNetCore" />
|
||||
|
||||
<PackageReference Include="OpenTelemetry.Hosting" Version="$(OpenTelemetryPackageVersion)" />
|
||||
<PackageReference Include="OpenTelemetry.Exporter.Zipkin" Version="$(OpenTelemetryPackageVersion)" />
|
||||
<PackageReference Include="OpenTelemetry.Collector.Dependencies" Version="$(OpenTelemetryPackageVersion)" />
|
||||
<PackageReference Include="OpenTelemetry.Collector.AspNetCore" Version="$(OpenTelemetryPackageVersion)" />
|
||||
<PackageReference Include="OpenTelemetry.Exporter.Zipkin" />
|
||||
<PackageReference Include="OpenTelemetry.Extensions.Hosting" />
|
||||
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" />
|
||||
<PackageReference Include="OpenTelemetry.Instrumentation.GrpcNetClient" />
|
||||
<PackageReference Include="OpenTelemetry.Instrumentation.Http" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
@ -1,97 +0,0 @@
|
|||
#region Copyright notice and license
|
||||
|
||||
// Copyright 2019 The gRPC Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using Count;
|
||||
using Greet;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using OpenTelemetry.Trace.Configuration;
|
||||
|
||||
namespace Server
|
||||
{
|
||||
public partial class Startup
|
||||
{
|
||||
private readonly IConfiguration _configuration;
|
||||
private const string EnableOpenTelemetryKey = "EnableOpenTelemetry";
|
||||
|
||||
public Startup(IConfiguration configuration)
|
||||
{
|
||||
_configuration = configuration;
|
||||
}
|
||||
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddGrpc();
|
||||
services.AddSingleton<IncrementingCounter>();
|
||||
|
||||
if (_configuration.GetValue<bool>(EnableOpenTelemetryKey))
|
||||
{
|
||||
services.AddOpenTelemetry(telemetry =>
|
||||
{
|
||||
telemetry.UseZipkin(o => o.ServiceName = "aggregator");
|
||||
telemetry.AddDependencyCollector();
|
||||
telemetry.AddRequestCollector();
|
||||
});
|
||||
}
|
||||
|
||||
// These clients will call back to the server
|
||||
services
|
||||
.AddGrpcClient<Greeter.GreeterClient>((s, o) => { o.Address = GetCurrentAddress(s); })
|
||||
.EnableCallContextPropagation();
|
||||
services
|
||||
.AddGrpcClient<Counter.CounterClient>((s, o) => { o.Address = GetCurrentAddress(s); })
|
||||
.EnableCallContextPropagation();
|
||||
|
||||
static Uri GetCurrentAddress(IServiceProvider serviceProvider)
|
||||
{
|
||||
// Get the address of the current server from the request
|
||||
var context = serviceProvider.GetRequiredService<IHttpContextAccessor>()?.HttpContext;
|
||||
if (context == null)
|
||||
{
|
||||
throw new InvalidOperationException("Could not get HttpContext.");
|
||||
}
|
||||
|
||||
return new Uri($"{context.Request.Scheme}://{context.Request.Host.Value}");
|
||||
}
|
||||
}
|
||||
|
||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||
{
|
||||
if (env.IsDevelopment())
|
||||
{
|
||||
app.UseDeveloperExceptionPage();
|
||||
}
|
||||
|
||||
app.UseRouting();
|
||||
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
endpoints.MapGrpcService<GreeterService>();
|
||||
endpoints.MapGrpcService<CounterService>();
|
||||
endpoints.MapGrpcService<AggregatorService>();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.29521.150
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Client", "Client\Client.csproj", "{B22D0F2E-D67A-413E-9450-4B64A60B56EF}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Server", "Server\Server.csproj", "{09CAF21C-D7D8-478C-9E74-3678DF615B8F}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{B22D0F2E-D67A-413E-9450-4B64A60B56EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{B22D0F2E-D67A-413E-9450-4B64A60B56EF}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{B22D0F2E-D67A-413E-9450-4B64A60B56EF}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{B22D0F2E-D67A-413E-9450-4B64A60B56EF}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{09CAF21C-D7D8-478C-9E74-3678DF615B8F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{09CAF21C-D7D8-478C-9E74-3678DF615B8F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{09CAF21C-D7D8-478C-9E74-3678DF615B8F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{09CAF21C-D7D8-478C-9E74-3678DF615B8F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {95736335-0C8B-4FDA-8722-E08046339B83}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,4 @@
|
|||
<Solution>
|
||||
<Project Path="Client/Client.csproj" />
|
||||
<Project Path="Server/Server.csproj" />
|
||||
</Solution>
|
|
@ -1,20 +1,17 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.1</TargetFramework>
|
||||
<RazorLangVersion>3.0</RazorLangVersion>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Blazor" Version="$(MicrosoftAspNetCoreBlazorPackageVersion)" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Blazor.Build" Version="$(MicrosoftAspNetCoreBlazorPackageVersion)" PrivateAssets="all" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Blazor.HttpClient" Version="$(MicrosoftAspNetCoreBlazorPackageVersion)" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Blazor.DevServer" Version="$(MicrosoftAspNetCoreBlazorPackageVersion)" PrivateAssets="all" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" PrivateAssets="all" />
|
||||
|
||||
<PackageReference Include="Google.Protobuf" Version="$(GoogleProtobufPackageVersion)" />
|
||||
<PackageReference Include="Grpc.Tools" Version="$(GrpcPackageVersion)" PrivateAssets="All" />
|
||||
<PackageReference Include="Grpc.Net.Client" Version="$(GrpcDotNetPackageVersion)" />
|
||||
<PackageReference Include="Grpc.Net.Client.Web" Version="$(GrpcDotNetPackageVersion)" />
|
||||
<PackageReference Include="Google.Protobuf" />
|
||||
<PackageReference Include="Grpc.Tools" PrivateAssets="All" />
|
||||
<PackageReference Include="Grpc.Net.Client" />
|
||||
<PackageReference Include="Grpc.Net.Client.Web" />
|
||||
|
||||
<Protobuf Include="..\Proto\weather.proto" GrpcServices="Client" Link="Protos\weather.proto" Access="Internal" />
|
||||
<Protobuf Include="..\Proto\count.proto" GrpcServices="Client" Link="Protos\count.proto" Access="Internal" />
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
@page "/counter"
|
||||
@inject GrpcChannel Channel
|
||||
@using Google.Protobuf.WellKnownTypes
|
||||
@using Grpc.Core
|
||||
|
||||
<h1>Counter</h1>
|
||||
|
@ -26,7 +25,7 @@
|
|||
cts = new CancellationTokenSource();
|
||||
|
||||
var client = new Count.Counter.CounterClient(Channel);
|
||||
var call = client.StartCounter(new Empty(), cancellationToken: cts.Token);
|
||||
using var call = client.StartCounter(new CounterRequest() { Start = currentCount }, cancellationToken: cts.Token);
|
||||
|
||||
try
|
||||
{
|
||||
|
|
|
@ -20,9 +20,10 @@ using System.Net.Http;
|
|||
using System.Threading.Tasks;
|
||||
using Grpc.Net.Client;
|
||||
using Grpc.Net.Client.Web;
|
||||
using Microsoft.AspNetCore.Blazor.Hosting;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Weather;
|
||||
|
||||
namespace Client
|
||||
{
|
||||
|
@ -31,25 +32,28 @@ namespace Client
|
|||
public static async Task Main(string[] args)
|
||||
{
|
||||
var builder = WebAssemblyHostBuilder.CreateDefault(args);
|
||||
builder.RootComponents.Add<App>("app");
|
||||
|
||||
// Blazor WA currently has an issue related to server streaming. No messages are returned from the server until the call is complete.
|
||||
// Setting WasmHttpMessageHandler.StreamingEnabled to true (reflection required) allows server streaming to work - https://github.com/mono/mono/issues/18718
|
||||
var wasmHttpMessageHandlerType = System.Reflection.Assembly.Load("WebAssembly.Net.Http").GetType("WebAssembly.Net.Http.HttpClient.WasmHttpMessageHandler");
|
||||
var streamingProperty = wasmHttpMessageHandlerType.GetProperty("StreamingEnabled", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static);
|
||||
streamingProperty.SetValue(null, true, null);
|
||||
builder.RootComponents.Add<App>("#app");
|
||||
|
||||
builder.Services.AddSingleton(services =>
|
||||
{
|
||||
// Create a gRPC-Web channel pointing to the backend server.
|
||||
// Get the service address from appsettings.json
|
||||
var config = services.GetRequiredService<IConfiguration>();
|
||||
var backendUrl = config["BackendUrl"];
|
||||
|
||||
// If no address is set then fallback to the current webpage URL
|
||||
if (string.IsNullOrEmpty(backendUrl))
|
||||
{
|
||||
var navigationManager = services.GetRequiredService<NavigationManager>();
|
||||
backendUrl = navigationManager.BaseUri;
|
||||
}
|
||||
|
||||
// Create a channel with a GrpcWebHandler that is addressed to the backend server.
|
||||
//
|
||||
// GrpcWebText is used because server streaming requires it. If server streaming is not used in your app
|
||||
// then GrpcWeb is recommended because it produces smaller messages.
|
||||
var httpClient = new HttpClient(new GrpcWebHandler(GrpcWebMode.GrpcWebText, new HttpClientHandler()));
|
||||
var httpHandler = new GrpcWebHandler(GrpcWebMode.GrpcWebText, new HttpClientHandler());
|
||||
|
||||
var channel = GrpcChannel.ForAddress("https://localhost:5001", new GrpcChannelOptions { HttpClient = httpClient });
|
||||
|
||||
return channel;
|
||||
return GrpcChannel.ForAddress(backendUrl, new GrpcChannelOptions { HttpHandler = httpHandler });
|
||||
});
|
||||
|
||||
await builder.Build().RunAsync();
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
// Explicit backend URL (override current site)
|
||||
"BackendUrl": null
|
||||
}
|
|
@ -14,7 +14,7 @@ a, .btn-link {
|
|||
border-color: #1861ac;
|
||||
}
|
||||
|
||||
app {
|
||||
#app {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
@ -151,7 +151,7 @@ app {
|
|||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
app {
|
||||
#app {
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
</head>
|
||||
|
||||
<body>
|
||||
<app>Loading...</app>
|
||||
<div id="app">Loading...</div>
|
||||
|
||||
<div id="blazor-error-ui">
|
||||
An unhandled error has occurred.
|
||||
|
|
|
@ -14,12 +14,14 @@
|
|||
|
||||
syntax = "proto3";
|
||||
|
||||
import "google/protobuf/empty.proto";
|
||||
|
||||
package count;
|
||||
|
||||
service Counter {
|
||||
rpc StartCounter (google.protobuf.Empty) returns (stream CounterResponse);
|
||||
rpc StartCounter (CounterRequest) returns (stream CounterResponse);
|
||||
}
|
||||
|
||||
message CounterRequest {
|
||||
int32 start = 1;
|
||||
}
|
||||
|
||||
message CounterResponse {
|
||||
|
|
|
@ -16,25 +16,38 @@
|
|||
|
||||
#endregion
|
||||
|
||||
using Microsoft.AspNetCore;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.AspNetCore.ResponseCompression;
|
||||
using Server.Services;
|
||||
|
||||
namespace Server
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
builder.Services.AddGrpc();
|
||||
builder.Services.AddResponseCompression(opts =>
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
BuildWebHost(args).Run();
|
||||
}
|
||||
opts.MimeTypes = ResponseCompressionDefaults.MimeTypes.Concat(
|
||||
new[] { "application/octet-stream" });
|
||||
});
|
||||
|
||||
public static IWebHost BuildWebHost(string[] args) =>
|
||||
WebHost.CreateDefaultBuilder(args)
|
||||
.UseConfiguration(new ConfigurationBuilder()
|
||||
.AddCommandLine(args)
|
||||
.Build())
|
||||
.UseStartup<Startup>()
|
||||
.Build();
|
||||
}
|
||||
var app = builder.Build();
|
||||
app.UseResponseCompression();
|
||||
|
||||
if (app.Environment.IsDevelopment())
|
||||
{
|
||||
app.UseWebAssemblyDebugging();
|
||||
}
|
||||
else
|
||||
{
|
||||
app.UseHsts();
|
||||
}
|
||||
|
||||
app.UseBlazorFrameworkFiles();
|
||||
app.UseStaticFiles();
|
||||
|
||||
app.UseRouting();
|
||||
|
||||
app.UseGrpcWeb();
|
||||
|
||||
app.MapGrpcService<WeatherService>().EnableGrpcWeb();
|
||||
app.MapGrpcService<CounterService>().EnableGrpcWeb();
|
||||
app.MapFallbackToFile("index.html");
|
||||
|
||||
app.Run();
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:59193/",
|
||||
"sslPort": 44375
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": true,
|
||||
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"Server": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": true,
|
||||
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"applicationUrl": "https://localhost:5001;http://localhost:5000"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,16 +1,17 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<UserSecretsId>46982f83-f153-443e-b589-4b2bc7b5945e</UserSecretsId>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Protobuf Include="..\Proto\weather.proto" GrpcServices="Server" Link="Protos\weather.proto" />
|
||||
<Protobuf Include="..\Proto\count.proto" GrpcServices="Server" Link="Protos\count.proto" />
|
||||
|
||||
<PackageReference Include="Microsoft.AspNetCore.Blazor.Server" Version="$(MicrosoftAspNetCoreBlazorPackageVersion)" />
|
||||
<PackageReference Include="Grpc.AspNetCore" Version="$(GrpcDotNetPackageVersion)" />
|
||||
<PackageReference Include="Grpc.AspNetCore.Web" Version="$(GrpcDotNetPackageVersion)" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" />
|
||||
<PackageReference Include="Grpc.AspNetCore" />
|
||||
<PackageReference Include="Grpc.AspNetCore.Web" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -19,19 +19,16 @@
|
|||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Count;
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using Grpc.Core;
|
||||
|
||||
namespace Server.Services
|
||||
{
|
||||
public class CounterService : Counter.CounterBase
|
||||
{
|
||||
public override async Task StartCounter(Empty request, IServerStreamWriter<CounterResponse> responseStream, ServerCallContext context)
|
||||
public override async Task StartCounter(CounterRequest request, IServerStreamWriter<CounterResponse> responseStream, ServerCallContext context)
|
||||
{
|
||||
var count = 0;
|
||||
var count = request.Start;
|
||||
|
||||
// Attempt to run until canceled by the client
|
||||
// Blazor WA is unable to cancel a call that has started - https://github.com/mono/mono/issues/18717
|
||||
while (!context.CancellationToken.IsCancellationRequested)
|
||||
{
|
||||
await responseStream.WriteAsync(new CounterResponse
|
||||
|
|
|
@ -1,69 +0,0 @@
|
|||
#region Copyright notice and license
|
||||
|
||||
// Copyright 2019 The gRPC Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#endregion
|
||||
|
||||
using System.Linq;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.ResponseCompression;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Server.Services;
|
||||
|
||||
namespace Server
|
||||
{
|
||||
public class Startup
|
||||
{
|
||||
// This method gets called by the runtime. Use this method to add services to the container.
|
||||
// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddGrpc();
|
||||
services.AddResponseCompression(opts =>
|
||||
{
|
||||
opts.MimeTypes = ResponseCompressionDefaults.MimeTypes.Concat(
|
||||
new[] { "application/octet-stream" });
|
||||
});
|
||||
}
|
||||
|
||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||
{
|
||||
app.UseResponseCompression();
|
||||
|
||||
if (env.IsDevelopment())
|
||||
{
|
||||
app.UseDeveloperExceptionPage();
|
||||
app.UseBlazorDebugging();
|
||||
}
|
||||
|
||||
app.UseStaticFiles();
|
||||
app.UseClientSideBlazorFiles<Client.Program>();
|
||||
|
||||
app.UseRouting();
|
||||
|
||||
app.UseGrpcWeb();
|
||||
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
endpoints.MapGrpcService<WeatherService>().EnableGrpcWeb();
|
||||
endpoints.MapGrpcService<CounterService>().EnableGrpcWeb();
|
||||
endpoints.MapFallbackToClientSideBlazor<Client.Program>("index.html");
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*"
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.29230.61
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Server", "Server\Server.csproj", "{534AC5F8-2DF2-40BD-87A5-B3D8310118C4}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{534AC5F8-2DF2-40BD-87A5-B3D8310118C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{534AC5F8-2DF2-40BD-87A5-B3D8310118C4}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{534AC5F8-2DF2-40BD-87A5-B3D8310118C4}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{534AC5F8-2DF2-40BD-87A5-B3D8310118C4}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {D22B3129-3BFB-41FA-9FCE-E45EBEF8C2DD}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,3 @@
|
|||
<Solution>
|
||||
<Project Path="Server/Server.csproj" />
|
||||
</Solution>
|
|
@ -16,23 +16,24 @@
|
|||
|
||||
#endregion
|
||||
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Server.Services;
|
||||
|
||||
namespace Server
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
builder.Services.AddGrpc();
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
if (!app.Environment.IsDevelopment())
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
CreateHostBuilder(args).Build().Run();
|
||||
}
|
||||
|
||||
public static IHostBuilder CreateHostBuilder(string[] args) =>
|
||||
Host.CreateDefaultBuilder(args)
|
||||
.ConfigureWebHostDefaults(webBuilder =>
|
||||
{
|
||||
webBuilder.UseStartup<Startup>();
|
||||
});
|
||||
}
|
||||
app.UseHsts();
|
||||
}
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
app.UseDefaultFiles();
|
||||
app.UseStaticFiles();
|
||||
|
||||
app.UseGrpcWeb();
|
||||
|
||||
app.MapGrpcService<GreeterService>().EnableGrpcWeb();
|
||||
|
||||
app.Run();
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<SpaRoot>wwwroot\</SpaRoot>
|
||||
<DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**;$(SpaRoot)dist\**</DefaultItemExcludes>
|
||||
</PropertyGroup>
|
||||
|
@ -9,8 +9,8 @@
|
|||
<ItemGroup>
|
||||
<Protobuf Include="..\Proto\greet.proto" GrpcServices="Server" Link="Protos\greet.proto" />
|
||||
|
||||
<PackageReference Include="Grpc.AspNetCore" Version="$(GrpcDotNetPackageVersion)" />
|
||||
<PackageReference Include="Grpc.AspNetCore.Web" Version="$(GrpcDotNetPackageVersion)" />
|
||||
<PackageReference Include="Grpc.AspNetCore" />
|
||||
<PackageReference Include="Grpc.AspNetCore.Web" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="DebugEnsureNodeEnv" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' And !Exists('$(SpaRoot)node_modules') ">
|
||||
|
|
|
@ -1,59 +0,0 @@
|
|||
#region Copyright notice and license
|
||||
|
||||
// Copyright 2019 The gRPC Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#endregion
|
||||
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Server.Services;
|
||||
|
||||
namespace Server
|
||||
{
|
||||
public class Startup
|
||||
{
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddGrpc();
|
||||
}
|
||||
|
||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||
{
|
||||
if (env.IsDevelopment())
|
||||
{
|
||||
app.UseDeveloperExceptionPage();
|
||||
}
|
||||
else
|
||||
{
|
||||
app.UseHsts();
|
||||
}
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
app.UseDefaultFiles();
|
||||
app.UseStaticFiles();
|
||||
|
||||
app.UseRouting();
|
||||
|
||||
app.UseGrpcWeb();
|
||||
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
endpoints.MapGrpcService<GreeterService>().EnableGrpcWeb();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
|
@ -4,10 +4,5 @@
|
|||
"Default": "Information"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"Kestrel": {
|
||||
"EndpointDefaults": {
|
||||
"Protocols": "Http2"
|
||||
}
|
||||
}
|
||||
"AllowedHosts": "*"
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ var resultText = document.getElementById('result');
|
|||
var streamingCall = null;
|
||||
|
||||
// Unary call
|
||||
sendInput.onclick =function () {
|
||||
sendInput.onclick = function () {
|
||||
var request = new HelloRequest();
|
||||
request.setName(nameInput.value);
|
||||
|
||||
|
@ -30,10 +30,15 @@ streamInput.onclick = function () {
|
|||
request.setName(nameInput.value);
|
||||
|
||||
streamingCall = client.sayHellos(request, {});
|
||||
streamingCall.on('data', function (response) {
|
||||
streamingCall.on('data', (response) => {
|
||||
resultText.innerHTML += htmlEscape(response.getMessage()) + '<br />';
|
||||
});
|
||||
streamingCall.on('end', function () {
|
||||
streamingCall.on('status', (status) => {
|
||||
if (status.code == 0) {
|
||||
resultText.innerHTML += 'Done';
|
||||
} else {
|
||||
resultText.innerHTML += 'Error: ' + htmlEscape(status.details);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
streamingCall.cancel();
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -5,9 +5,8 @@
|
|||
"devDependencies": {
|
||||
"@grpc/proto-loader": "^0.3.0",
|
||||
"google-protobuf": "^3.6.1",
|
||||
"grpc": "^1.15.0",
|
||||
"grpc-web": "^1.0.0",
|
||||
"webpack": "^4.16.5",
|
||||
"webpack-cli": "^3.1.0"
|
||||
"webpack": "^5.94.0",
|
||||
"webpack-cli": "^5.0.1"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.29230.61
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Server", "Server\Server.csproj", "{534AC5F8-2DF2-40BD-87A5-B3D8310118C4}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Client", "Client\Client.csproj", "{48A1D3BC-A14B-436A-8822-6DE2BEF8B747}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{534AC5F8-2DF2-40BD-87A5-B3D8310118C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{534AC5F8-2DF2-40BD-87A5-B3D8310118C4}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{534AC5F8-2DF2-40BD-87A5-B3D8310118C4}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{534AC5F8-2DF2-40BD-87A5-B3D8310118C4}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{48A1D3BC-A14B-436A-8822-6DE2BEF8B747}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{48A1D3BC-A14B-436A-8822-6DE2BEF8B747}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{48A1D3BC-A14B-436A-8822-6DE2BEF8B747}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{48A1D3BC-A14B-436A-8822-6DE2BEF8B747}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {D22B3129-3BFB-41FA-9FCE-E45EBEF8C2DD}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,4 @@
|
|||
<Solution>
|
||||
<Project Path="Client/Client.csproj" />
|
||||
<Project Path="Server/Server.csproj" />
|
||||
</Solution>
|
|
@ -2,15 +2,15 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Protobuf Include="..\Proto\certify.proto" GrpcServices="Client" Link="Protos\certify.proto" />
|
||||
|
||||
<PackageReference Include="Google.Protobuf" Version="$(GoogleProtobufPackageVersion)" />
|
||||
<PackageReference Include="Grpc.Net.Client" Version="$(GrpcDotNetPackageVersion)" />
|
||||
<PackageReference Include="Grpc.Tools" Version="$(GrpcPackageVersion)" PrivateAssets="All" />
|
||||
<PackageReference Include="Google.Protobuf" />
|
||||
<PackageReference Include="Grpc.Net.Client" />
|
||||
<PackageReference Include="Grpc.Tools" PrivateAssets="All" />
|
||||
|
||||
<None Update="Certs\client.pfx">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
|
|
|
@ -16,79 +16,66 @@
|
|||
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Net.Http;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using System.Threading.Tasks;
|
||||
using Certify;
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using Grpc.Core;
|
||||
using Grpc.Net.Client;
|
||||
|
||||
namespace Client
|
||||
// The server will return 403 (Forbidden). The method requires a certificate
|
||||
await CallCertificateInfo(includeClientCertificate: false);
|
||||
|
||||
// The server will return a successful gRPC response
|
||||
await CallCertificateInfo(includeClientCertificate: true);
|
||||
|
||||
Console.WriteLine("Press any key to exit...");
|
||||
Console.ReadKey();
|
||||
|
||||
static async Task CallCertificateInfo(bool includeClientCertificate)
|
||||
{
|
||||
public class Program
|
||||
try
|
||||
{
|
||||
static async Task Main(string[] args)
|
||||
Console.WriteLine($"Setting up HttpClient. Client has certificate: {includeClientCertificate}");
|
||||
using var channel = GrpcChannel.ForAddress("https://localhost:5001", new GrpcChannelOptions
|
||||
{
|
||||
// The server will return 403 (Forbidden). The method requires a certificate
|
||||
await CallCertificateInfo(includeClientCertificate: false);
|
||||
HttpHandler = CreateHttpHandler(includeClientCertificate)
|
||||
});
|
||||
var client = new Certifier.CertifierClient(channel);
|
||||
|
||||
// The server will return a successful gRPC response
|
||||
await CallCertificateInfo(includeClientCertificate: true);
|
||||
Console.WriteLine("Sending gRPC call...");
|
||||
var certificateInfo = await client.GetCertificateInfoAsync(new Empty());
|
||||
|
||||
Console.WriteLine("Press any key to exit...");
|
||||
Console.ReadKey();
|
||||
}
|
||||
|
||||
private static async Task CallCertificateInfo(bool includeClientCertificate)
|
||||
Console.WriteLine($"Server received client certificate: {certificateInfo.HasCertificate}");
|
||||
if (certificateInfo.HasCertificate)
|
||||
{
|
||||
try
|
||||
{
|
||||
Console.WriteLine($"Setting up HttpClient. Client has certificate: {includeClientCertificate}");
|
||||
var channel = GrpcChannel.ForAddress("https://localhost:5001", new GrpcChannelOptions
|
||||
{
|
||||
HttpClient = CreateHttpClient(includeClientCertificate)
|
||||
});
|
||||
var client = new Certifier.CertifierClient(channel);
|
||||
|
||||
Console.WriteLine("Sending gRPC call...");
|
||||
var certificateInfo = await client.GetCertificateInfoAsync(new Empty());
|
||||
|
||||
Console.WriteLine($"Server received client certificate: {certificateInfo.HasCertificate}");
|
||||
if (certificateInfo.HasCertificate)
|
||||
{
|
||||
Console.WriteLine($"Client certificate name: {certificateInfo.Name}");
|
||||
}
|
||||
}
|
||||
catch (RpcException ex)
|
||||
{
|
||||
Console.WriteLine($"gRPC error from calling service: {ex.Status.Detail}");
|
||||
}
|
||||
catch
|
||||
{
|
||||
Console.WriteLine($"Unexpected error calling service.");
|
||||
throw;
|
||||
}
|
||||
Console.WriteLine($"Client certificate name: {certificateInfo.Name}");
|
||||
}
|
||||
|
||||
private static HttpClient CreateHttpClient(bool includeClientCertificate)
|
||||
{
|
||||
var handler = new HttpClientHandler();
|
||||
|
||||
if (includeClientCertificate)
|
||||
{
|
||||
// Load client certificate
|
||||
var basePath = Path.GetDirectoryName(typeof(Program).Assembly.Location);
|
||||
var certPath = Path.Combine(basePath!, "Certs", "client.pfx");
|
||||
var clientCertificate = new X509Certificate2(certPath, "1111");
|
||||
handler.ClientCertificates.Add(clientCertificate);
|
||||
}
|
||||
|
||||
// Create client
|
||||
return new HttpClient(handler);
|
||||
}
|
||||
|
||||
}
|
||||
catch (RpcException ex)
|
||||
{
|
||||
Console.WriteLine($"gRPC error from calling service: {ex.Status.Detail}");
|
||||
}
|
||||
catch
|
||||
{
|
||||
Console.WriteLine($"Unexpected error calling service.");
|
||||
throw;
|
||||
}
|
||||
|
||||
Console.WriteLine();
|
||||
}
|
||||
|
||||
static HttpClientHandler CreateHttpHandler(bool includeClientCertificate)
|
||||
{
|
||||
var handler = new HttpClientHandler();
|
||||
|
||||
if (includeClientCertificate)
|
||||
{
|
||||
// Load client certificate
|
||||
var basePath = Path.GetDirectoryName(typeof(Program).Assembly.Location);
|
||||
var certPath = Path.Combine(basePath!, "Certs", "client.pfx");
|
||||
var clientCertificate = X509CertificateLoader.LoadPkcs12FromFile(certPath, "1111");
|
||||
handler.ClientCertificates.Add(clientCertificate);
|
||||
}
|
||||
|
||||
return handler;
|
||||
}
|
||||
|
|
|
@ -16,31 +16,36 @@
|
|||
|
||||
#endregion
|
||||
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using Microsoft.AspNetCore.Authentication.Certificate;
|
||||
using Microsoft.AspNetCore.Server.Kestrel.Https;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Server;
|
||||
|
||||
namespace Server
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
builder.WebHost.ConfigureKestrel(kestrelOptions =>
|
||||
{
|
||||
public class Program
|
||||
kestrelOptions.ConfigureHttpsDefaults(httpsOptions =>
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
CreateHostBuilder(args).Build().Run();
|
||||
}
|
||||
httpsOptions.ClientCertificateMode = ClientCertificateMode.AllowCertificate;
|
||||
});
|
||||
});
|
||||
|
||||
public static IHostBuilder CreateHostBuilder(string[] args) =>
|
||||
Host.CreateDefaultBuilder(args)
|
||||
.ConfigureWebHostDefaults(webBuilder =>
|
||||
{
|
||||
webBuilder.ConfigureKestrel(kestrelOptions =>
|
||||
{
|
||||
kestrelOptions.ConfigureHttpsDefaults(httpsOptions =>
|
||||
{
|
||||
httpsOptions.ClientCertificateMode = ClientCertificateMode.AllowCertificate;
|
||||
});
|
||||
});
|
||||
webBuilder.UseStartup<Startup>();
|
||||
});
|
||||
}
|
||||
}
|
||||
builder.Services.AddGrpc();
|
||||
builder.Services.AddAuthorization();
|
||||
builder.Services.AddAuthentication(CertificateAuthenticationDefaults.AuthenticationScheme)
|
||||
.AddCertificate(options =>
|
||||
{
|
||||
// Not recommended in production environments. The example is using a self-signed test certificate.
|
||||
options.RevocationMode = X509RevocationMode.NoCheck;
|
||||
options.ChainTrustValidationMode = X509ChainTrustMode.CustomRootTrust;
|
||||
options.AllowedCertificateTypes = CertificateTypes.All;
|
||||
});
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
app.UseAuthentication();
|
||||
app.UseAuthorization();
|
||||
|
||||
app.MapGrpcService<CertifierService>();
|
||||
|
||||
app.Run();
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Protobuf Include="..\Proto\certify.proto" GrpcServices="Server" Link="Protos\certify.proto" />
|
||||
|
||||
<PackageReference Include="Grpc.AspNetCore" Version="$(GrpcDotNetPackageVersion)" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.Certificate" Version="$(MicrosoftAspNetCorePackageVersion)" />
|
||||
<PackageReference Include="Grpc.AspNetCore" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.Certificate" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
@ -1,62 +0,0 @@
|
|||
#region Copyright notice and license
|
||||
|
||||
// Copyright 2019 The gRPC Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#endregion
|
||||
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using Microsoft.AspNetCore.Authentication.Certificate;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
|
||||
namespace Server
|
||||
{
|
||||
public class Startup
|
||||
{
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddGrpc();
|
||||
|
||||
services.AddAuthorization();
|
||||
services.AddAuthentication(CertificateAuthenticationDefaults.AuthenticationScheme)
|
||||
.AddCertificate(options =>
|
||||
{
|
||||
// Not recommended in production environments. The example is using a self-signed test certificate.
|
||||
options.RevocationMode = X509RevocationMode.NoCheck;
|
||||
options.AllowedCertificateTypes = CertificateTypes.All;
|
||||
});
|
||||
}
|
||||
|
||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||
{
|
||||
if (env.IsDevelopment())
|
||||
{
|
||||
app.UseDeveloperExceptionPage();
|
||||
}
|
||||
|
||||
app.UseRouting();
|
||||
|
||||
app.UseAuthentication();
|
||||
app.UseAuthorization();
|
||||
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
endpoints.MapGrpcService<CertifierService>();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
<Solution>
|
||||
<Project Path="Client/Client.csproj" />
|
||||
<Project Path="Server/Server.csproj" />
|
||||
</Solution>
|
|
@ -0,0 +1,16 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Protobuf Include="..\Proto\data_channel.proto" GrpcServices="Client" Link="Protos\data_channel.proto" />
|
||||
|
||||
<PackageReference Include="Google.Protobuf" />
|
||||
<PackageReference Include="Grpc.Net.Client" />
|
||||
<PackageReference Include="Grpc.Tools" PrivateAssets="All" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
|
@ -0,0 +1,66 @@
|
|||
#region Copyright notice and license
|
||||
|
||||
// Copyright 2019 The gRPC Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#endregion
|
||||
|
||||
using System.Text;
|
||||
using DataChannel;
|
||||
using Google.Protobuf;
|
||||
using Grpc.Core;
|
||||
using Grpc.Net.Client;
|
||||
|
||||
using var channel = GrpcChannel.ForAddress("https://localhost:5001");
|
||||
var client = new DataChanneler.DataChannelerClient(channel);
|
||||
|
||||
await UploadDataAsync(client);
|
||||
|
||||
await DownloadResultsAsync(client);
|
||||
|
||||
Console.WriteLine("Shutting down");
|
||||
Console.WriteLine("Press any key to exit...");
|
||||
Console.ReadKey();
|
||||
|
||||
static async Task UploadDataAsync(DataChanneler.DataChannelerClient client)
|
||||
{
|
||||
var call = client.UploadData();
|
||||
|
||||
var dataChunks = TestData.Chunk(5);
|
||||
foreach (var chunk in dataChunks)
|
||||
{
|
||||
Console.WriteLine($"Uploading chunk: {chunk.Length} bytes");
|
||||
await call.RequestStream.WriteAsync(new DataRequest { Value = ByteString.CopyFrom(chunk) });
|
||||
}
|
||||
|
||||
await call.RequestStream.CompleteAsync();
|
||||
|
||||
var result = await call;
|
||||
Console.WriteLine($"Total upload processed: {result.BytesProcessed} bytes");
|
||||
}
|
||||
|
||||
static async Task DownloadResultsAsync(DataChanneler.DataChannelerClient client)
|
||||
{
|
||||
var call = client.DownloadResults(new DataRequest { Value = ByteString.CopyFrom(TestData) });
|
||||
|
||||
await foreach (var result in call.ResponseStream.ReadAllAsync())
|
||||
{
|
||||
Console.WriteLine($"Downloaded bytes processed result: {result.BytesProcessed}");
|
||||
}
|
||||
}
|
||||
|
||||
public partial class Program
|
||||
{
|
||||
private static readonly byte[] TestData = Encoding.UTF8.GetBytes("The quick brown fox jumped over the lazy dog.");
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
// Copyright 2019 The gRPC Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
package data_channel;
|
||||
|
||||
service DataChanneler {
|
||||
rpc UploadData (stream DataRequest) returns (DataResult);
|
||||
rpc DownloadResults (DataRequest) returns (stream DataResult);
|
||||
}
|
||||
|
||||
message DataRequest {
|
||||
bytes value = 1;
|
||||
}
|
||||
|
||||
message DataResult {
|
||||
int32 bytes_processed = 1;
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
#region Copyright notice and license
|
||||
|
||||
// Copyright 2019 The gRPC Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#endregion
|
||||
|
||||
using Server;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
builder.Services.AddGrpc();
|
||||
|
||||
var app = builder.Build();
|
||||
app.MapGrpcService<DataChannelerService>();
|
||||
|
||||
app.Run();
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"profiles": {
|
||||
"Server": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": false,
|
||||
"applicationUrl": "https://localhost:5001",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Protobuf Include="..\Proto\data_channel.proto" GrpcServices="Server" Link="Protos\data_channel.proto" />
|
||||
|
||||
<PackageReference Include="Grpc.AspNetCore" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
|
@ -0,0 +1,107 @@
|
|||
#region Copyright notice and license
|
||||
|
||||
// Copyright 2019 The gRPC Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#endregion
|
||||
|
||||
using System.Threading.Channels;
|
||||
using DataChannel;
|
||||
using Grpc.Core;
|
||||
|
||||
namespace Server
|
||||
{
|
||||
public class DataChannelerService : DataChanneler.DataChannelerBase
|
||||
{
|
||||
private readonly ILogger _logger;
|
||||
|
||||
public DataChannelerService(ILoggerFactory loggerFactory)
|
||||
{
|
||||
_logger = loggerFactory.CreateLogger<DataChannelerService>();
|
||||
}
|
||||
|
||||
public override async Task<DataResult> UploadData(
|
||||
IAsyncStreamReader<DataRequest> requestStream, ServerCallContext context)
|
||||
{
|
||||
var channel = Channel.CreateBounded<DataRequest>(new BoundedChannelOptions(capacity: 5)
|
||||
{
|
||||
SingleReader = false,
|
||||
SingleWriter = true
|
||||
});
|
||||
|
||||
var readTask = Task.Run(async () =>
|
||||
{
|
||||
await foreach (var message in requestStream.ReadAllAsync())
|
||||
{
|
||||
await channel.Writer.WriteAsync(message);
|
||||
}
|
||||
|
||||
channel.Writer.Complete();
|
||||
});
|
||||
|
||||
// Process incoming messages on three threads.
|
||||
var bytesProcessedByThread = await Task.WhenAll(
|
||||
ProcessMessagesAsync(channel.Reader, _logger),
|
||||
ProcessMessagesAsync(channel.Reader, _logger),
|
||||
ProcessMessagesAsync(channel.Reader, _logger));
|
||||
|
||||
await readTask;
|
||||
|
||||
return new DataResult { BytesProcessed = bytesProcessedByThread.Sum() };
|
||||
|
||||
static async Task<int> ProcessMessagesAsync(ChannelReader<DataRequest> reader, ILogger logger)
|
||||
{
|
||||
var total = 0;
|
||||
await foreach (var message in reader.ReadAllAsync())
|
||||
{
|
||||
total += message.Value.Length;
|
||||
}
|
||||
return total;
|
||||
}
|
||||
}
|
||||
|
||||
public override async Task DownloadResults(DataRequest request,
|
||||
IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
|
||||
{
|
||||
var channel = Channel.CreateBounded<DataResult>(new BoundedChannelOptions(capacity: 5)
|
||||
{
|
||||
SingleReader = true,
|
||||
SingleWriter = false
|
||||
});
|
||||
|
||||
var consumerTask = Task.Run(async () =>
|
||||
{
|
||||
// Consume messages from channel and write to response stream.
|
||||
await foreach (var message in channel.Reader.ReadAllAsync())
|
||||
{
|
||||
await responseStream.WriteAsync(message);
|
||||
}
|
||||
});
|
||||
|
||||
var dataChunks = request.Value.Chunk(size: 10);
|
||||
|
||||
// Write messages to channel from multiple threads.
|
||||
await Task.WhenAll(dataChunks.Select(
|
||||
async c =>
|
||||
{
|
||||
var message = new DataResult { BytesProcessed = c.Length };
|
||||
await channel.Writer.WriteAsync(message);
|
||||
}));
|
||||
|
||||
// Complete writing and wait for consumer to complete.
|
||||
channel.Writer.Complete();
|
||||
await consumerTask;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Debug",
|
||||
"System": "Information",
|
||||
"Grpc": "Information",
|
||||
"Microsoft": "Information"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Shared\Shared.csproj" />
|
||||
|
||||
<PackageReference Include="Grpc.Net.Client" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,31 @@
|
|||
#region Copyright notice and license
|
||||
|
||||
// Copyright 2019 The gRPC Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#endregion
|
||||
|
||||
using Grpc.Net.Client;
|
||||
using ProtoBuf.Grpc.Client;
|
||||
using Shared;
|
||||
|
||||
using var channel = GrpcChannel.ForAddress("https://localhost:5001");
|
||||
var client = channel.CreateGrpcService<IGreeterService>();
|
||||
|
||||
var reply = await client.SayHelloAsync(new HelloRequest { Name = "GreeterClient" });
|
||||
Console.WriteLine("Greeting: " + reply.Message);
|
||||
|
||||
Console.WriteLine("Shutting down");
|
||||
Console.WriteLine("Press any key to exit...");
|
||||
Console.ReadKey();
|
|
@ -0,0 +1,5 @@
|
|||
<Solution>
|
||||
<Project Path="Client/Client.csproj" />
|
||||
<Project Path="Server/Server.csproj" />
|
||||
<Project Path="Shared/Shared.csproj" />
|
||||
</Solution>
|
|
@ -0,0 +1,29 @@
|
|||
#region Copyright notice and license
|
||||
|
||||
// Copyright 2019 The gRPC Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#endregion
|
||||
|
||||
using ProtoBuf.Grpc.Server;
|
||||
using Server;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
builder.Services.AddGrpc();
|
||||
builder.Services.AddCodeFirstGrpc();
|
||||
|
||||
var app = builder.Build();
|
||||
app.MapGrpcService<GreeterService>();
|
||||
|
||||
app.Run();
|
|
@ -0,0 +1,13 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Shared\Shared.csproj" />
|
||||
|
||||
<PackageReference Include="protobuf-net.Grpc.AspNetCore" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
|
@ -0,0 +1,41 @@
|
|||
#region Copyright notice and license
|
||||
|
||||
// Copyright 2019 The gRPC Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#endregion
|
||||
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using ProtoBuf.Grpc;
|
||||
using Shared;
|
||||
|
||||
namespace Server
|
||||
{
|
||||
public class GreeterService : IGreeterService
|
||||
{
|
||||
private readonly ILogger _logger;
|
||||
|
||||
public GreeterService(ILoggerFactory loggerFactory)
|
||||
{
|
||||
_logger = loggerFactory.CreateLogger<GreeterService>();
|
||||
}
|
||||
|
||||
public Task<HelloReply> SayHelloAsync(HelloRequest request, CallContext context = default)
|
||||
{
|
||||
_logger.LogInformation($"Sending hello to {request.Name}");
|
||||
return Task.FromResult(new HelloReply { Message = "Hello " + request.Name });
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Debug",
|
||||
"System": "Information",
|
||||
"Grpc": "Information",
|
||||
"Microsoft": "Information"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"Kestrel": {
|
||||
"EndpointDefaults": {
|
||||
"Protocols": "Http2"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -16,15 +16,14 @@
|
|||
|
||||
#endregion
|
||||
|
||||
using System.Threading.Tasks;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace BenchmarkClient.Worker
|
||||
namespace Shared
|
||||
{
|
||||
public interface IWorker
|
||||
[DataContract]
|
||||
public class HelloReply
|
||||
{
|
||||
int Id { get; }
|
||||
Task ConnectAsync();
|
||||
Task DisconnectAsync();
|
||||
Task CallAsync();
|
||||
[DataMember(Order = 1)]
|
||||
public string? Message { get; set; }
|
||||
}
|
||||
}
|
|
@ -16,11 +16,14 @@
|
|||
|
||||
#endregion
|
||||
|
||||
namespace BenchmarkClient
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Shared
|
||||
{
|
||||
public class BenchmarkResult
|
||||
[DataContract]
|
||||
public class HelloRequest
|
||||
{
|
||||
[DataMember(Order = 1)]
|
||||
public string? Name { get; set; }
|
||||
public int RequestCount { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
#region Copyright notice and license
|
||||
|
||||
// Copyright 2019 The gRPC Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#endregion
|
||||
|
||||
using System.ServiceModel;
|
||||
using System.Threading.Tasks;
|
||||
using ProtoBuf.Grpc;
|
||||
|
||||
namespace Shared
|
||||
{
|
||||
[ServiceContract]
|
||||
public interface IGreeterService
|
||||
{
|
||||
[OperationContract]
|
||||
Task<HelloReply> SayHelloAsync(HelloRequest request, CallContext context = default);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="protobuf-net.Grpc" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
|
@ -0,0 +1,15 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Protobuf Include="..\Proto\greet.proto" GrpcServices="Client" Link="Protos\greet.proto" />
|
||||
|
||||
<PackageReference Include="Google.Protobuf" />
|
||||
<PackageReference Include="Grpc.Net.Client" />
|
||||
<PackageReference Include="Grpc.Tools" PrivateAssets="All" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,42 @@
|
|||
#region Copyright notice and license
|
||||
|
||||
// Copyright 2019 The gRPC Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#endregion
|
||||
|
||||
using Greet;
|
||||
using Grpc.Core;
|
||||
using Grpc.Net.Client;
|
||||
|
||||
using var channel = GrpcChannel.ForAddress("https://localhost:5001");
|
||||
var client = new Greeter.GreeterClient(channel);
|
||||
|
||||
await UnaryCallExample(client);
|
||||
|
||||
Console.WriteLine("Shutting down");
|
||||
Console.WriteLine("Press any key to exit...");
|
||||
Console.ReadKey();
|
||||
|
||||
static async Task UnaryCallExample(Greeter.GreeterClient client)
|
||||
{
|
||||
// 'grpc-internal-encoding-request' is a special metadata value that tells
|
||||
// the client to compress the request.
|
||||
// This metadata is only used in the client is not sent as a header to the server.
|
||||
var metadata = new Metadata();
|
||||
metadata.Add("grpc-internal-encoding-request", "gzip");
|
||||
|
||||
var reply = await client.SayHelloAsync(new HelloRequest { Name = "GreeterClient" }, headers: metadata);
|
||||
Console.WriteLine("Greeting: " + reply.Message);
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
<Solution>
|
||||
<Project Path="Client/Client.csproj" />
|
||||
<Project Path="Server/Server.csproj" />
|
||||
</Solution>
|
|
@ -0,0 +1,30 @@
|
|||
#region Copyright notice and license
|
||||
|
||||
// Copyright 2019 The gRPC Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#endregion
|
||||
|
||||
using Server;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
builder.Services.AddGrpc(o =>
|
||||
{
|
||||
o.ResponseCompressionAlgorithm = "gzip";
|
||||
});
|
||||
|
||||
var app = builder.Build();
|
||||
app.MapGrpcService<GreeterService>();
|
||||
|
||||
app.Run();
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"profiles": {
|
||||
"Server": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": false,
|
||||
"applicationUrl": "https://localhost:5001",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,13 +1,13 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Protobuf Include="..\Proto\greet.proto" GrpcServices="Server" Link="Protos\greet.proto" />
|
||||
|
||||
<PackageReference Include="Grpc.AspNetCore" Version="$(GrpcDotNetPackageVersion)" />
|
||||
<PackageReference Include="Grpc.AspNetCore" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
|
@ -16,7 +16,6 @@
|
|||
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Greet;
|
||||
using Grpc.Core;
|
|
@ -16,7 +16,6 @@
|
|||
|
||||
#endregion
|
||||
|
||||
using Client;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
@ -28,9 +27,9 @@ namespace Server
|
|||
{
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddGrpc(options =>
|
||||
services.AddGrpc(o =>
|
||||
{
|
||||
options.Interceptors.Add<ServerLoggerInterceptor>();
|
||||
o.ResponseCompressionAlgorithm = "gzip";
|
||||
});
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Debug",
|
||||
"System": "Information",
|
||||
"Grpc": "Information",
|
||||
"Microsoft": "Information"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"Kestrel": {
|
||||
"EndpointDefaults": {
|
||||
"Protocols": "Http2"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Protobuf Include="..\Proto\weather.proto" GrpcServices="Server" Link="Protos\weather.proto" />
|
||||
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" />
|
||||
<PackageReference Include="Grpc.AspNetCore" />
|
||||
<PackageReference Include="Grpc.AspNetCore.Web" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
|
@ -0,0 +1,14 @@
|
|||
FROM mcr.microsoft.com/dotnet/sdk:10.0-preview AS build-env
|
||||
WORKDIR /app
|
||||
|
||||
# Copy everything
|
||||
COPY . ./
|
||||
RUN dotnet --info
|
||||
RUN dotnet restore examples/Container/Backend
|
||||
RUN dotnet publish examples/Container/Backend -c Release -o out
|
||||
|
||||
# Build runtime image
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:10.0-preview
|
||||
WORKDIR /app
|
||||
COPY --from=build-env /app/out .
|
||||
ENTRYPOINT ["dotnet", "Backend.dll"]
|
|
@ -0,0 +1,28 @@
|
|||
#region Copyright notice and license
|
||||
|
||||
// Copyright 2019 The gRPC Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#endregion
|
||||
|
||||
using Server.Services;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
builder.Logging.SetMinimumLevel(LogLevel.Trace);
|
||||
builder.Services.AddGrpc();
|
||||
|
||||
var app = builder.Build();
|
||||
app.MapGrpcService<WeatherService>();
|
||||
|
||||
app.Run();
|
|
@ -0,0 +1,57 @@
|
|||
#region Copyright notice and license
|
||||
|
||||
// Copyright 2019 The gRPC Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using Grpc.Core;
|
||||
using Weather;
|
||||
|
||||
namespace Server.Services
|
||||
{
|
||||
public class WeatherService : WeatherForecasts.WeatherForecastsBase
|
||||
{
|
||||
private static readonly string[] Summaries = new[]
|
||||
{
|
||||
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
|
||||
};
|
||||
|
||||
public override async Task<GetWeatherForecastsResponse> GetWeatherForecasts(Empty request, ServerCallContext context)
|
||||
{
|
||||
var httpContext = context.GetHttpContext();
|
||||
await context.WriteResponseHeadersAsync(new Metadata
|
||||
{
|
||||
{ "host", $"{httpContext.Request.Scheme}://{httpContext.Request.Host}" }
|
||||
});
|
||||
|
||||
var rng = new Random();
|
||||
var results = Enumerable.Range(1, 5).Select(index => new WeatherForecast
|
||||
{
|
||||
Date = DateTime.UtcNow.AddDays(index).ToTimestamp(),
|
||||
TemperatureC = rng.Next(-20, 55),
|
||||
Summary = Summaries[rng.Next(Summaries.Length)]
|
||||
}).ToArray();
|
||||
|
||||
var response = new GetWeatherForecastsResponse();
|
||||
response.Forecasts.AddRange(results);
|
||||
|
||||
return response;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Debug",
|
||||
"System": "Information",
|
||||
"Grpc": "Information",
|
||||
"Microsoft": "Information"
|
||||
}
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue