在 .Net 5 中添加对 netNamedPipeBinding 的引用

Add reference to netNamedPipeBinding in .Net 5

我在 .net Framework 4.6.1 中有 class 库项目。我必须将该项目迁移到 .net 5。 这样做时我遇到了 netNamedPipeBinding 的错误。

Severity    Code    Description Project File    Line    Suppression State
Error   CS0246  The type or namespace name 'NetNamedPipeBinding' could not be found (are you missing a using directive or an assembly reference?)    

已安装以下 nuget 包。

System.ServiceModel.Duplex
System.ServiceModel.Http
System.ServiceModel.NetTcp
System.ServiceModel.Primitives

有什么办法让它起作用吗?

看起来不支持。

Named pipes
WCF provided a named pipes binding for communication between processes on the same physical machine. The first release of ASP.NET Core gRPC does not support named pipes. Adding client and server support for named pipes (and Unix domain sockets) is a goal for a future release.

https://docs.microsoft.com/en-us/dotnet/architecture/grpc-for-wcf-developers/wcf-bindings#named-pipes

此外,NamedPipeBinding 的文档页面已解析为 .NET 4.8 部分,.NET 5
不存在 https://docs.microsoft.com/en-us/dotnet/api/system.servicemodel.netnamedpipebinding

HttpBinding .NET 5
的文档页面 https://docs.microsoft.com/en-us/dotnet/api/system.servicemodel.nethttpbinding