簡體   English   中英

在.Net Standard中創建管道時出現UnauthorizedAccessException

[英]UnauthorizedAccessException when creating Pipes in .Net Standard

我正在嘗試創建一個NamedPipeServerStream,但是當我創建它們時,我得到了一個

UnauthorizedAccessException

問題是我在.Net Standard中,因此PipeSecurity沒有構造函數。 有什么解決辦法的想法嗎? 您是否需要在UWP清單中添加某些內容?

我在.Net Standard 2.0中,因為該DLL隨后在通用應用中使用

.Net標准代碼:

namespace DataSender {
public class PipeSender {

    private NamedPipeServerStream server;
    private StreamWriter writer;

    public PipeSender(string name) {
        server = new NamedPipeServerStream(name, PipeDirection.Out);
    } ...

和UWP代碼:

public sealed partial class MainPage : Page {
    public MainPage() {
        this.InitializeComponent();

        PipeSender sender = new PipeSender("testPipe");
    }
}

解決了,它是防火牆。 只需禁用它

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM