question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I got an NullReferenceException

See original GitHub issue

Hello 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)

  1. Open Keepass
  2. File -> Open -> Open From OneDrive
  3. Click Microsoft Graph
  4. Wait…
  5. Select store Refresh Token to KeePass database
  6. Select One Drive db file
  7. Select local path “D:\KeePass Password Safe 2\db”, this path exists, and file name is “main.kdbx”
  8. 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:closed
  • Created 4 years ago
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
DanielHH87commented, Jul 8, 2019

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

0reactions
KoenZomerscommented, Jul 7, 2019

This issue should be fixed in version 2.0.7.1. Please let me know if this does fix it for you.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found