2017-08-02 73 views
0

試圖使用Npgsql的,並得到一個錯誤加載以下組件從UWP應用程序連接到一個Postgres數據庫:錯誤從UWP應用程序連接到Postgres數據庫

"System.Net.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 

這是確切的例外:

{System.IO.FileNotFoundException: Could not load file or assembly 'System.Net.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified. 
File name: 'System.Net.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' 
    at Npgsql.NpgsqlConnector.<RawOpen>d__139.MoveNext() 
    at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine) 
    at Npgsql.NpgsqlConnector.RawOpen(NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken) 
    at Npgsql.NpgsqlConnector.<Open>d__136.MoveNext() 
--- End of stack trace from previous location where exception was thrown --- 
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
    at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) 
    at Npgsql.ConnectorPool.<AllocateLong>d__24.MoveNext() 
--- End of stack trace from previous location where exception was thrown --- 
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
    at System.Runtime.CompilerServices.ValueTaskAwaiter`1.GetResult() 
    at Npgsql.NpgsqlConnection.<Open>d__24.MoveNext() 
--- End of stack trace from previous location where exception was thrown --- 
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
    at Npgsql.NpgsqlConnection.Open() 
    at ... >>> here goes my code 

回答

1

這是一個已知問題,請參閱https://github.com/npgsql/npgsql/issues/820

不幸的是,你將有幾個月的時間,直到UWP支持netstandard20,在這一點上,這將消失。

+0

現在會嘗試使用標準2.0預覽工作嗎? – Bishoy