exception

Android: What is a “Bad file number” SocketException?

折月煮酒 提交于 2020-01-14 10:23:08
问题 I'm getting a "SocketException: Bad file number" while attempting to read from a socket in an Android app and I have no idea what this means. I've googled it and haven't found any explanation of what it is. Any ideas? Thanks. 回答1: This is usually the result of the underlying socket being closed. The "number" is because file handles in the underlying C code use file numbers to identify handles. The socket may be closed by you, but it may also be closed by security exceptions, flaky network,

Android: What is a “Bad file number” SocketException?

谁说胖子不能爱 提交于 2020-01-14 10:23:08
问题 I'm getting a "SocketException: Bad file number" while attempting to read from a socket in an Android app and I have no idea what this means. I've googled it and haven't found any explanation of what it is. Any ideas? Thanks. 回答1: This is usually the result of the underlying socket being closed. The "number" is because file handles in the underlying C code use file numbers to identify handles. The socket may be closed by you, but it may also be closed by security exceptions, flaky network,

Android: What is a “Bad file number” SocketException?

帅比萌擦擦* 提交于 2020-01-14 10:23:07
问题 I'm getting a "SocketException: Bad file number" while attempting to read from a socket in an Android app and I have no idea what this means. I've googled it and haven't found any explanation of what it is. Any ideas? Thanks. 回答1: This is usually the result of the underlying socket being closed. The "number" is because file handles in the underlying C code use file numbers to identify handles. The socket may be closed by you, but it may also be closed by security exceptions, flaky network,

'object' does not contain a definition for 'Name'

北城以北 提交于 2020-01-14 09:10:06
问题 I'm using two DataContext objects to return seperate AsQueriable() datasets then joining the two using linq. The data construction works perfectly however when I pass that combined dataset to the view, I'm getting the error 'object' does not contain a definition for 'Name'. During a debug session I can clearly see that both the parent Model and each 'item' in the foreach loop has all the data and keys visible/accessible. I'm very confused. Many of the other q&a's on stackoverflow.com that

Testing abstract class throws InstantiationException

China☆狼群 提交于 2020-01-14 08:48:30
问题 It's the first time I've written JUnit tests and I came across the following problem. I have to write the tests for an abstract class and I was told to do it this way: http://marcovaltas.com/2011/09/23/abstract-class-testing-using-junit.html However, when I try to run the first test I get an InstantiationException like this: java.lang.InstantiationException at java.lang.reflect.Constructor.newInstance(Constructor.java:526) Here's the test I'm running: /** * Test of setNumber method, of class

Final managed exception handler in a mixed native/managed executable?

爱⌒轻易说出口 提交于 2020-01-14 08:41:28
问题 I have an MFC application compiled with /clr and I'm trying to implement a final handler for otherwise un-caught managed exceptions. For native exceptions, overriding CWinApp::ProcessWndProcException works. The two events suggested in Jeff's CodeProject article, Application.ThreadException and AppDomain.CurrentDomain.UnhandledException , are not raised. Can anyone suggest a way to provide a final managed exception handler for a mixed executable? Update: It appears that these exception

Exception from HRESULT: 0x80004002 (E_NOINTERFACE)

旧街凉风 提交于 2020-01-14 07:48:08
问题 I'm in charge of the maintenance of a C# application (VS 2005). This C# applications calls a dll ("mydll.dll"). I needed to make a few changes on the dll in question. I have the file "mydll.vbp" that was written in Visual Basic 6.0. I made my changes in Visual Studio and, then, "made "mydll"" from the Visual Basic interface. The problem is that, now, at each time I try to instance a class from "mydll.dll" in debbuger mode in C#, I have the following "InvalidCastException" Unable to cast COM

“Only run on the main thread” exception is simulator only

和自甴很熟 提交于 2020-01-14 07:23:27
问题 I'm getting a "only run on the main thread" exception somewhere deep inside (or after) [self.navigationController pushViewController:controller animated:YES]; The thing is it only happens on Simulator and not while debugging in an IOS device. Any chance I can work around this? The dump: 2014-03-25 15:18:45.061 Cookila[657:5507] *** Assertion failure in void _UIPerformResizeOfTextViewForTextContainer(NSLayoutManager *, UIView<NSTextContainerView> *, NSTextContainer *, NSUInteger)(),

Why is XmlSerializer throwing an InvalidOperationException?

 ̄綄美尐妖づ 提交于 2020-01-14 07:19:27
问题 public void Save() { XmlSerializer Serializer = new XmlSerializer(typeof(DatabaseInformation)); /* A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll A first chance exception of type 'System.InvalidOperationException' occurred in System.Xml.dll */ // .... } This is the whole class if you need it: public class DatabaseInformation { /* Create new database */

Why is XmlSerializer throwing an InvalidOperationException?

最后都变了- 提交于 2020-01-14 07:18:00
问题 public void Save() { XmlSerializer Serializer = new XmlSerializer(typeof(DatabaseInformation)); /* A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll A first chance exception of type 'System.InvalidOperationException' occurred in System.Xml.dll */ // .... } This is the whole class if you need it: public class DatabaseInformation { /* Create new database */