I got an NullReferenceException
See original GitHub issueHello there, After the authorization was successful, I chose to store the RefreshToken to KeePass, and then selected the db file in OneDrive. I encountered an error when selecting which file to save to the local.
Step (authorized)
- Open Keepass
- File -> Open -> Open From OneDrive
- Click Microsoft Graph
- Wait…
- Select store Refresh Token to KeePass database
- Select One Drive db file
- Select local path “D:\KeePass Password Safe 2\db”, this path exists, and file name is “main.kdbx”
- Error, select continue or quit
When I chose to store the Refresh Token, I tried another option, stored locally, and encountered the same error.
I tried to download the db file from the web page and then chose to store the RefreshToken to KeePass. I encountered a warning: Failed to sync database, can’t find path “D:\KeePass Password Safe 2\db\db\main.kdbx”, I The path selected should be “D:\KeePass Password Safe 2\db\main.kdbx”
有关调用实时(JIT)调试而不是此对话框的详细信息,
请参见此消息的结尾。
************** 异常文本 **************
System.NullReferenceException: 未将对象引用设置到对象的实例。
在 KoenZomersKeePassOneDriveSync.Providers.OneDriveProvider.<OpenFromOneDriveCloudProvider>d__19.MoveNext()
--- 引发异常的上一位置中堆栈跟踪的末尾 ---
在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
在 KoenZomersKeePassOneDriveSync.KeePassDatabase.<OpenDatabaseFromCloudService>d__2.MoveNext()
--- 引发异常的上一位置中堆栈跟踪的末尾 ---
在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
在 KoenZomersKeePassOneDriveSync.KoenZomersKeePassOneDriveSyncExt.<MenuFileOpenFromOneDriveOnClick>d__9.MoveNext()
--- 引发异常的上一位置中堆栈跟踪的末尾 ---
在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
************** 已加载的程序集 **************
mscorlib
程序集版本:4.0.0.0
Win32 版本:4.7.3416.0 built by: NET472REL1LAST_B
基本代码:file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------
KeePass
程序集版本:2.42.1.23464
Win32 版本:2.42.1.0
基本代码:file:///D:/KeePass%20Password%20Safe%202/KeePass.exe
----------------------------------------
System
程序集版本:4.0.0.0
Win32 版本:4.7.3416.0 built by: NET472REL1LAST_B
基本代码:file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Windows.Forms
程序集版本:4.0.0.0
Win32 版本:4.7.3324.0 built by: NET472REL1LAST_C
基本代码:file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
程序集版本:4.0.0.0
Win32 版本:4.7.3190.0 built by: NET472REL1LAST_C
基本代码:file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
程序集版本:4.0.0.0
Win32 版本:4.7.3324.0 built by: NET472REL1LAST_C
基本代码:file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Core
程序集版本:4.0.0.0
Win32 版本:4.7.3362.0 built by: NET472REL1LAST_C
基本代码:file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Xml
程序集版本:4.0.0.0
Win32 版本:4.7.3190.0 built by: NET472REL1LAST_C
基本代码:file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Windows.Forms.resources
程序集版本:4.0.0.0
Win32 版本:4.7.3190.0 built by: NET472REL1LAST_C
基本代码:file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms.resources/v4.0_4.0.0.0_zh-Hans_b77a5c561934e089/System.Windows.Forms.resources.dll
----------------------------------------
KoenZomersKeePassOneDriveSync
程序集版本:2.0.6.0
Win32 版本:2.0.6.0
基本代码:file:///C:/Users/XXXX/AppData/Local/KeePass/PluginCache/qjRc3mDqplTaKdqcHF0g/KoenZomersKeePassOneDriveSync.dll
----------------------------------------
Newtonsoft.Json
程序集版本:8.0.0.0
Win32 版本:8.0.1.19229
基本代码:file:///C:/Users/XXXX/AppData/Local/KeePass/PluginCache/qjRc3mDqplTaKdqcHF0g/Newtonsoft.Json.DLL
----------------------------------------
System.Numerics
程序集版本:4.0.0.0
Win32 版本:4.7.3190.0 built by: NET472REL1LAST_C
基本代码:file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
----------------------------------------
System.Runtime.Serialization
程序集版本:4.0.0.0
Win32 版本:4.7.3324.0 built by: NET472REL1LAST_C
基本代码:file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Serialization/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Serialization.dll
----------------------------------------
System.Xml.Linq
程序集版本:4.0.0.0
Win32 版本:4.7.3190.0 built by: NET472REL1LAST_C
基本代码:file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml.Linq/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.Linq.dll
----------------------------------------
System.Data
程序集版本:4.0.0.0
Win32 版本:4.7.3260.0 built by: NET472REL1LAST_C
基本代码:file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Security
程序集版本:4.0.0.0
Win32 版本:4.7.3190.0 built by: NET472REL1LAST_C
基本代码:file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Security/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Security.dll
----------------------------------------
KeePass.XmlSerializers
程序集版本:2.42.1.23464
Win32 版本:2.42.1.23464
基本代码:file:///D:/KeePass%20Password%20Safe%202/KeePass.XmlSerializers.DLL
----------------------------------------
mscorlib.resources
程序集版本:4.0.0.0
Win32 版本:4.7.3190.0 built by: NET472REL1LAST_C
基本代码:file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/mscorlib.resources/v4.0_4.0.0.0_zh-Hans_b77a5c561934e089/mscorlib.resources.dll
----------------------------------------
KoenZomers.OneDrive.Api
程序集版本:2.3.0.3
Win32 版本:2.3.0.3
基本代码:file:///C:/Users/XXXX/AppData/Local/KeePass/PluginCache/qjRc3mDqplTaKdqcHF0g/KoenZomers.OneDrive.Api.DLL
----------------------------------------
Microsoft.mshtml
程序集版本:7.0.3300.0
Win32 版本:7.0.3300.0
基本代码:file:///C:/WINDOWS/assembly/GAC/Microsoft.mshtml/7.0.3300.0__b03f5f7f11d50a3a/Microsoft.mshtml.dll
----------------------------------------
System.Web
程序集版本:4.0.0.0
Win32 版本:4.7.3282.0 built by: NET472REL1LAST_B
基本代码:file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/System.Web/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Web.dll
----------------------------------------
System.Net.Http
程序集版本:4.0.0.0
Win32 版本:4.7.3190.0 built by: NET472REL1LAST_C
基本代码:file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Net.Http/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Net.Http.dll
----------------------------------------
Accessibility
程序集版本:4.0.0.0
Win32 版本:4.7.3190.0 built by: NET472REL1LAST_C
基本代码:file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
************** JIT 调试 **************
要启用实时(JIT)调试,
该应用程序或计算机的 .config 文件(machine.config)的 system.windows.forms 节中必须设置
jitDebugging 值。
编译应用程序时还必须启用
调试。
例如:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
启用 JIT 调试后,任何未经处理的异常
都将被发送到在此计算机上注册的 JIT 调试程序,
而不是由此对话框处理。
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (5 by maintainers)
Top Results From Across the Web
c# - What is a NullReferenceException, and how do I fix it?
The runtime throwing a NullReferenceException always means the same thing: you are trying to use a reference, and the reference is not ...
Read more >Object Reference Not Set to an Instance of an Object
This infamous and dreaded error message happens when you get a NullReferenceException. This exception is thrown when you try to access a member—for...
Read more >NullReferenceException Class (System)
A NullReferenceException exception is thrown by a method that is passed null . Some methods validate the arguments that are passed to them....
Read more >What is NullReferenceException in C#? - Code Maze
In C#, a null object is an uninitialized object. This means that the object doesn't have a value (other than null) assigned to...
Read more >NullReferenceException in C#
The NullReferenceException is an exception that will be thrown while accessing a null object. The following example shows the code that ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Good morning Koen,
I tested it and now I am able to add a kdbx-database from OneDrive and save it locally, without an exception. It is working now! Thank you pretty much!
Regards, Daniel
This issue should be fixed in version 2.0.7.1. Please let me know if this does fix it for you.