jjzjj

InvalidOperationException

全部标签

c# - 当属性不能为 null 时使用什么异常类型?

在我的应用程序中,如果特定类的属性为null或空(如果它是字符串),我需要抛出异常。我不确定在这种情况下使用什么是最好的异常(exception)。我不想创建一个新的异常,而且我不确定ArgumentNullException在这种情况下是否合适。我应该创建一个新的异常(exception)还是有一个我可以使用的异常(exception)?我不介意抛出ApplicationException。 最佳答案 MSDNguidelinesforstandardexceptions状态:Dousevalueforthenameoftheim

c# - 当属性不能为 null 时使用什么异常类型?

在我的应用程序中,如果特定类的属性为null或空(如果它是字符串),我需要抛出异常。我不确定在这种情况下使用什么是最好的异常(exception)。我不想创建一个新的异常,而且我不确定ArgumentNullException在这种情况下是否合适。我应该创建一个新的异常(exception)还是有一个我可以使用的异常(exception)?我不介意抛出ApplicationException。 最佳答案 MSDNguidelinesforstandardexceptions状态:Dousevalueforthenameoftheim

c# - 系统.InvalidOperationException : Unable to generate a temporary class (result=1)

我使用.net3.5开发了一个应用程序,并将其作为.exe部署在具有相同环境的多台机器上。但是,在一台特定的机器上,我收到以下错误。堆栈跟踪:有关调用的详细信息,请参阅此消息的末尾即时(JIT)调试而不是此对话框。System.InvalidOperationException:Unabletogenerateatemporaryclass(result=1).errorCS2001:Sourcefile'C:\WINDOWS\TEMP\wz58eig4.0.cs'couldnotbefounderrorCS2008:NoinputsspecifiedatSystem.Xml.Seri

c# - 系统.InvalidOperationException : Unable to generate a temporary class (result=1)

我使用.net3.5开发了一个应用程序,并将其作为.exe部署在具有相同环境的多台机器上。但是,在一台特定的机器上,我收到以下错误。堆栈跟踪:有关调用的详细信息,请参阅此消息的末尾即时(JIT)调试而不是此对话框。System.InvalidOperationException:Unabletogenerateatemporaryclass(result=1).errorCS2001:Sourcefile'C:\WINDOWS\TEMP\wz58eig4.0.cs'couldnotbefounderrorCS2008:NoinputsspecifiedatSystem.Xml.Seri

c# - 解决 "The ObjectContext instance has been disposed and can no longer be used for operations that require a connection"InvalidOperationException

我正在尝试使用EntityFrameworkm填充GridView,但每次我都会收到以下错误:"Propertyaccessor'LoanProduct'onobject'COSIS_DAL.MemberLoan'threwthefollowingexception:TheObjectContextinstancehasbeendisposedandcannolongerbeusedforoperationsthatrequireaconnection."我的代码是:publicListGetAllMembersForLoan(stringkeyword){using(CosisEnt

c# - 解决 "The ObjectContext instance has been disposed and can no longer be used for operations that require a connection"InvalidOperationException

我正在尝试使用EntityFrameworkm填充GridView,但每次我都会收到以下错误:"Propertyaccessor'LoanProduct'onobject'COSIS_DAL.MemberLoan'threwthefollowingexception:TheObjectContextinstancehasbeendisposedandcannolongerbeusedforoperationsthatrequireaconnection."我的代码是:publicListGetAllMembersForLoan(stringkeyword){using(CosisEnt

Unity报错:InvalidOperationException:You are tring to read lnput using the UnityEngine. ……的解决办法

问题描述:我在运行steamVR的Interaction_Example时报错,其中unity为2021.3.6f1c1,steamVR(2.7.3),头显为HTCVivepro2。报错具体内容如下:InvalidOperationException:YouaretryingtoreadInputusingtheUnityEngine.Inputclass,butyouhaveswitchedactiveInputhandlingtoInputSystempackageinPlayerSettings.UnityEngine.Input.get_mousePosition()(at:0)问题解

.net - Python 中 .Net InvalidOperationException 的类比是什么?

.NetInvalidOperationException在Python中的类比是什么? 最佳答案 没有直接的等价物。通常ValueError或TypeError就足够了,如果它们都不适合,则可能是RuntimeError或NotImplementedError。 关于.net-Python中.NetInvalidOperationException的类比是什么?,我们在StackOverflow上找到一个类似的问题: https://stackoverflo

.net - Python 中 .Net InvalidOperationException 的类比是什么?

.NetInvalidOperationException在Python中的类比是什么? 最佳答案 没有直接的等价物。通常ValueError或TypeError就足够了,如果它们都不适合,则可能是RuntimeError或NotImplementedError。 关于.net-Python中.NetInvalidOperationException的类比是什么?,我们在StackOverflow上找到一个类似的问题: https://stackoverflo

System.InvalidOperationException:“未在本地计算机上注册“Microsoft.ACE.OLEDB.12.0”提供程序。”

在电脑上安装access驱动,Microsoft.ACE.OLEDB.12.0对应的是office2010需要安装64位的就安装64位 将目标平台改为X64插入数据代码publicstaticStringPathByConfig=Directory.GetCurrentDirectory();    publicstaticStringPath_Str=PathByConfig+"\\test.accdb";    StringconnStr=@"Provider=Microsoft.ACE.OLEDB.12.0;JetOLEDB:DataBasePassword=;DataSource="+