Browsing 7239 questions and answers with Jon Skeet
Okay, it looks like LINQ to XML is getting confused because the namespace is declared twice in the root element - once as the default namespace, and once with an alias of asmv2. The simplest solution is just to remove that attribute. To... more 8/6/2014 4:50:39 PM
While I suspect this is a duplicate, I can't easily find it. The problem is that in your desired XML, the ContainerCollection, Container and ContainerNumber elements are in the namespace "someNS" as that is the default inherited from their... more 8/6/2014 3:39:01 PM
Just add a new folder - then by default, new classes will be in that namespace. So for example, if you have a project called Foo, and you add a folder called Bar, then you'll end up with: namespace Foo.Bar { } at the top of classes in... more 8/6/2014 12:36:43 PM
One of the ancestor elements must be setting a default namespace, e.g. <foo xmlns="http://foo.bar"> <!-- Your element name --> </foo> If you want: <foo xmlns="http://foo.bar"> ... more 8/6/2014 11:38:39 AM
It sounds like you should pass "method body" in as a delegate: public void GiveMeAProperName(Action<DBContext> databaseAction) { try { using(var trans = new TransactionScope()) { using(var context =... more 8/6/2014 9:40:14 AM
You're trying to declare a variable as the only statement in an if statement body. That's not allowed, as it would be pointless - the variable would be out of scope immediately afterwards. Either you should declare the variable first: int... more 8/6/2014 9:11:20 AM
Well, 5 minutes is always 300,000 milliseconds, so: long millis = date1.getTime(); millis += 300000; Date date2 = new Date(millis); Or perhaps more readably: long millis = date1.getTime(); millis +=... more 8/6/2014 7:41:58 AM
The final } of the method is unreachable - you only get a compilation error if it's possible to get to the end of the method without returning a value. This is more useful for cases where the end of the method is unreachable due to an... more 8/6/2014 7:26:40 AM
It looks like you don't really need ProcessA to execute in a different thread at all - but you do need to keep track of your previous ProcessB thread. So something like: Thread previousThread = null; for (int i = 0; i < 20; i++) { ... more 8/6/2014 7:08:01 AM
(I still think this is a duplicate after you've done a bit of unpacking, but hey...) Expand the one statement into two: // Not exactly the same, but close... Integer tmp = condition2 ? 2 : null; Integer x = condition1 ? 1 : (int)... more 8/6/2014 6:52:42 AM