问题标签 [argumentnullexception]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
c# - 没有参数名称的 ArgumentNullException 消息
我在 C# 中的部分代码中抛出 ArgumentNullException。我想捕获并显示我的异常的错误消息。但没有参数名称。我想将参数名称传递给异常构造函数。
如果我打电话error.Message
,我会得到类似的东西
errorMessageStringVariable 参数名称:myParameter
我只想显示errorMessageStringVariable。是否可以使用 ArgumentNullException,而对 error.Message 没有某种格式?
c# - 什么可以在这里为空?
在我清除 Bing 地图的图钉并打开弹出窗口后,我的应用程序崩溃了。这是我在调试器中看到的:
文本块绝对不为空 - 它是在 XAML 中以声明方式定义的。
字符串列表 (CurrentlyMappedPhotosets) 不为空 - 如您所见,它包含一个字符串 / 计数为 1。
在尖叫声中看到之前的代码是:
什么可以在这里为空?
就在这发生之前,我调用了 ClearMap:
...调用 UpdateGUI():
c# - WCF 服务中的属性值正在获取 System.ArgumentNullException 说它为空,但它不是
我有一个视图从 WCF 服务填充到部分视图中的问题。一切正常,模型包含必要的数据,但不知何故,它不断收到此错误。我可以清楚地看到 ProduktDto 的值,所以它根本不为空,但仍然说它是。
听说错误可能在 connectionString 中,所以我将其包括在此处:
在认真的谷歌搜索之后,Havent 找到了答案。这是视图的代码:
c# - WPF 设计器:System.ArgumentNullException
首先,对不起我的英语不好。我在这里发帖是因为我知道有些人的答案非常相关。
我已经在 WPF 应用程序上工作了几个月,没有任何问题。从今天早上开始,每次我尝试在设计器中单击、更新或调整元素大小时,都会发生异常,我必须每 10 秒重新加载一次设计器。
这有点烦人,我真的不知道如何解决这个问题。
这是错误:
谢谢您的帮助。
c# - ArgumentNullException for nested members
Let's say I have a method:
It's clear that I should use ArgumentNullException as it shown above to validate that user is not null. Now how can I validate that user.Name is not empty? Would it be a good practice to do like that:
c# - ContentManager.Load 引发的 ArgumentNullException()
我试图设置一个静态类来将我的纹理存储在 XNA/MonoGame 中,这样我就可以将所有加载代码放在一个地方并全局访问纹理,但是有一个 bug 让我很生气..
字符串文字如何导致 ArugmentNullException?我习惯了 Java,其中 null 的处理方式有点不同,但这对我来说似乎很奇怪......
list - LINQtoCSV 无法将 IEnumerable 分配给 List - ArgumentNullException 未处理
我有读取并存储在 IEnumerable data_values 中的 csv 文件。唯一的问题是,当我想用 MessageBox.Show() 阅读它时,它会抛出 ArgumentNullException is unhandled。我试着像 if(data_values != null) 那样做,但它不起作用。我尝试了很多解决方案,但没有一个有效。我要做的就是将 date_values 中的数据分配给例如 temperature_values 并显示它。这是它的样子:
我想用以下方式展示它:
windows-phone-8.1 - 尝试打开 iBoxDb 连接时出现 ArgumentNullException
我正在尝试启动并运行 iBoxDb,但是,当尝试打开连接时,我得到 ArgumentNullException。完全相同的代码在 Windows Phone 8.1 Silverlight上运行良好,但在 WP 8.1运行时不运行。我尝试传递路径参数而不是""
(的各种组合ApplicationData.Current.LocalFolder
),但仍然没有。
由于 iBoxDb 几乎没有文档,我真的没有想法:|
编码:
堆栈跟踪:
System.ArgumentNullException occurred
_HResult=-2147467261
_message=Value cannot be null.
HResult=-2147467261
IsTransient=false
Message=Value cannot be null.
Parameter name: path1
Source=mscorlib
ParamName=path1
StackTrace:
at System.IO.Path.Combine(String path1, String path2)
at System.IO.IsolatedStorage.IsolatedStorageFile.FetchOrCreateRoot()
at System.IO.IsolatedStorage.IsolatedStorageFile.GetUserStore(String group, String id)
at System.IO.IsolatedStorage.IsolatedStorageFile.GetUserStoreForApplication()
at iBoxDB.LocalServer.IO.BoxIsolatedStorageFileStreamConfig.GetIsolatedStorageFile()
at iBoxDB.LocalServer.IO.BoxIsolatedStorageFileStreamConfig.CreateIsolatedStorageFileStream(String path, StreamAccess access)
at iBoxDB.LocalServer.IO.BoxIsolatedStorageFileStreamConfig.CreateStream(String path, StreamAccess access)
at q..ctor(String A_0, DatabaseConfig A_1, IBoxRecycler A_2)
at er.a(DatabaseConfig A_0, String A_1, IBoxRecycler A_2)
at ac..ctor(Int64 A_0, String A_1, DatabaseConfig A_2, IBoxRecycler A_3)
at iBoxDB.LocalServer.LocalDatabaseServer.a(String A_0, Int64 A_1)
at iBoxDB.LocalServer.LocalDatabaseServer.GetInstance(Int64 address)
at iBoxDB.LocalServer.DB.Open(Int64 destAddr)
at Budget.Data.iBoxDbRepository..ctor()
at lambda_method(Closure )
at SimpleInjector.Lifestyles.SingletonLifestyle.SingletonLifestyleRegistrationBase'1.CreateInstanceWithNullCheck()
at System.Lazy'1.CreateValue()
java - 为什么`outputFile.println("Package:" + letter);`行会出现空异常运行时错误?
我的代码当前编译并运行。但是,当程序到达该行时程序崩溃outputFile.println("Package: " + letter);
为什么outputFile.println("Package: " + letter);
和其他outputFile.println("");
导致程序崩溃并且不打印到文件dataFile
?dataFile
甚至在 try-catch 块执行时被创建?
c# - 空异常错误
这是我为算法类做的二叉树程序的代码。我不断收到一个空异常错误,但我不知道是什么原因造成的。
我在这里得到“rootNode”的异常 V
以及这 4 行中的“root”的更多异常错误 V
如果有人可以帮助我推断导致“root”和“rootNode”异常被抛出的原因,我会很高兴。它说它们是空的,但我不明白为什么它这么说。