小编Vin*_*nce的帖子

IIS 上的 ASP.NET Core grpc-Web 返回 404

.NET Core gRPC-Web 客户端在 http://localhost:5000 上调用 ASP.NET Core gRPC-Web 服务器工作正常。

使用虚拟应用程序(例如“http://build.mycompany.ca/myapp”)调用部署到 IIS 服务器的服务器的相同客户端代码会导致

状态(StatusCode =“未实现”,详细信息=“错误的gRPC响应。HTTP状态代码:404”)

我的 ASP.NET Core 3.1 服务器设置正确。即 app.UseGrpcWeb(new GrpcWebOptions { DefaultEnabled = true });

介于两者之间

app.UseRouting()
Run Code Online (Sandbox Code Playgroud)

app.UseEndpoints(endpoints => {
    endpoints.MapControllers();
    endpoints
        .MapGrpcService<GrpcClientService>()
        .EnableGrpcWeb();
});
Run Code Online (Sandbox Code Playgroud)

我在这里缺少什么想法吗?

grpc asp.net-core grpc-web

8
推荐指数
1
解决办法
5502
查看次数

“docker pull redis”在 Docker for Windows 上失败

我已经安装了适用于 Windows Server 2016 的 Docker EE,并且能够拉取并运行 hello-world 示例。

当我调用“docker pull redis”时,我得到:

Using default tag: latest
latest: Pulling from library/redis
no matching manifest for windows/amd64 in the manifest list entries
Run Code Online (Sandbox Code Playgroud)

我的码头工人版本:

Client:
 Version:      17.10.0-ee-preview-2
 API version:  1.32
 Go version:   go1.8.3
 Git commit:   10e292d
 Built:        Thu Sep 21 19:58:53 2017
 OS/Arch:      windows/amd64

Server:
 Version:      17.10.0-ee-preview-2
 API version:  1.32 (minimum version 1.24)
 Go version:   go1.8.3
 Git commit:   777d4a1
 Built:        Thu Sep 21 20:08:05 2017
 OS/Arch:      windows/amd64
 Experimental: false
Run Code Online (Sandbox Code Playgroud)

不确定我在这里做错了什么。

redis docker

5
推荐指数
1
解决办法
2835
查看次数

使用 C# 检查 SQL Server 表中是否存在记录的最佳方法是什么?

什么是最好的方法?取回 1 或 0?或者检查查询中的行是否可用?我在为 ExecuteScalar 争论,但对其他答案感兴趣,为什么或为什么不。

//using DataReader.HasRows?
bool result = false;

var cmd = new SqlCommand("select foo, bar from baz where id = 123", _sqlConnection, _sqlTransaction);

cmd.CommandType = System.Data.CommandType.Text;

using (var r = cmd.ExecuteReader())
{
    if (r != null && r.HasRows)
    {
        result = true;
    }
}

return result;

//or using Scalar?
bool result = false;

var cmd = new SqlCommand("if exists(select foo, bar from baz where id = 123) select 1 else select 0", _sqlConnection, _sqlTransaction);

cmd.CommandType = …
Run Code Online (Sandbox Code Playgroud)

c# t-sql sql-server

2
推荐指数
1
解决办法
2563
查看次数

标签 统计

asp.net-core ×1

c# ×1

docker ×1

grpc ×1

grpc-web ×1

redis ×1

sql-server ×1

t-sql ×1