The event log was obviously the first thing I should have checked, and I did find some useful backtraces. I'll augment those locations and add some more logging first.
|
|
# ? Apr 30, 2019 08:53 |
|
|
# ? Jun 8, 2024 05:59 |
Followup: Adding some log4net and logging unhandled exceptions in the App object was in fact a really good idea. (Thank you for making it easy to log exceptions for once.) It turns out a server was delivering truncated JSON data which caused the parser to throw, and I was not handling that.
|
|
# ? Apr 30, 2019 13:56 |
|
Great job! Glad I could be of some small assistance!
|
# ? Apr 30, 2019 15:08 |
|
NihilCredo posted:Edit: Come to think of it, you could separate the "backflow" from the events with a couple lines of code. It would be barely any safer than the event handler route, but it would convey intent much better: I had some time and got to work on this and I have to say this is really clever and elegant. To be honest I never really had a need for the val keyword so I didn't grasp how it would all fit together at first but I see now. Edit: I mean putting a func in a property. I had to do some FuncConvert stuff to get it to work on the C# side, but it works. Thanks! Mr Shiny Pants fucked around with this message at 10:05 on May 5, 2019 |
# ? May 5, 2019 00:08 |
|
LongSack posted:Is there a good reason why static classes can’t implement an interface? I have an instance where I’d love to declare a constructor as A DAL should definitely not be static. I'm curious to see what the code looks like inside one of these static DALs.
|
# ? May 6, 2019 04:41 |
|
I'd like to see the unit tests of components that call a static DAL.
|
# ? May 6, 2019 06:08 |
|
Xik posted:I'd like to see the unit tests of components that call a static DAL. #if UNIT using static MockDAL; #elseif INTEGRATION using static RealDAL; would probably work pretty well.
|
# ? May 6, 2019 07:40 |
|
NihilCredo posted:#if UNIT Thanks, I hate it.
|
# ? May 6, 2019 08:44 |
|
Microsoft is officially rebranding the next release of .net core as ".NET 5" as part of the process of deprecating .net framework (now that it will be possible to use stuff like wpf from .net core). This is similar to how they just announced that powershell core will just be called powershell from now on.
|
# ? May 6, 2019 19:41 |
|
mystes posted:Microsoft is officially rebranding the next release of .net core as ".NET 5" as part of the process of deprecating .net framework (now that it will be possible to use stuff like wpf from .net core). I only dabble with .net... does "use stuff like wpf from .net core" mean you could potentially use wpf in the linux runtime?
|
# ? May 6, 2019 20:28 |
|
bigmandan posted:I only dabble with .net... does "use stuff like wpf from .net core" mean you could potentially use wpf in the linux runtime? No. This is "One .NET." The doc explains it better than I ever could, but it doesn't change UI toolkits. WPF And WinForms are still very much tied to Windows. If you want a cross-platform UI toolkit, you should look at Xamarin.Forms, which can target WPF on Windows and GTK# on Linux, and a ton of other platforms.
|
# ? May 6, 2019 20:56 |
|
What's the actual status of GTK# support in Xamarin Forms? I searched for information a few weeks ago and I found some separate github repository from 6 months or so earlier, but it also hadn't been updated in months at that point; I thought maybe it was a bad sign but is it actually because it has been merged into mainline Xamarin Forms or something? Was there a release announcement that I missed? Edit: Is gtk# supposed to be officially coming out in Xamarin Forms 4.0? If so why does nothing in their website say so? mystes fucked around with this message at 21:10 on May 6, 2019 |
# ? May 6, 2019 21:04 |
|
mystes posted:Microsoft is officially rebranding the next release of .net core as ".NET 5" as part of the process of deprecating .net framework (now that it will be possible to use stuff like wpf from .net core). Well, I'm glad Microsoft aren't trying to make the .NET ecosystem even more confusing.
|
# ? May 6, 2019 21:10 |
|
redleader posted:Well, I'm glad Microsoft aren't trying to make the .NET ecosystem even more confusing. This should actually resolve a bunch of confusion about the .net ecosystem. I think the only major remaining point of confusion is having both desktop WPF and UWP. Microsoft doesn't seem eager to do anything about that but I think they're going to have to make some sort of decision within the next year or so. mystes fucked around with this message at 21:27 on May 6, 2019 |
# ? May 6, 2019 21:13 |
|
Yeah the big If here is if WPF et al actually go away in any meaningful sense
|
# ? May 6, 2019 21:49 |
|
I apologize in advance for the length of this reply.a hot gujju bhabhi posted:A DAL should definitely not be static. I'm curious to see what the code looks like inside one of these static DALs. Standard ADO CRUD operations. Like an example (stuff omitted since I’m on iPad): C# code:
I originally started using static DAL classes when the Print method for one of my programs literally needed twelve DAL classes passed in as parameters. Yes, I know how to fix that now, but here’s the thing - the static classes work, and work well for me. All that being said, I’ve taken the suggestions here to heart and am learning another way to do things. I’m currently rewriting my simplest program, a time tracking and reporting tool, to make these changes: 1. Replace JSON file timesheets with a database. 2. DB access is using EF Core 2.1 3. Project is using .NET Framework 4.7.2 and WPF for presentation. 4. The (non-static) DAL classes get POCO entity classes from EF and produce observable DTO classes that the ViewModels use. The DAL classes handle the translation between entity objects and DTO objects using a custom Mapper class. 5. The ViewModels get their DAL classes by using a custom Registrar class (which is static) that maps Interfaces to objects. The VMs request an interface and the registrar returns an instance of the class that implements that interface. Yes, it’s similar to DI. And, yes, I know I could have used “off-the-shelf” components for entity mapping and my “registrar”, but that’s not the point. I’m learning. An example, my Registrar class checks that the concrete type can actually be returned as an instance of the interface (using IsAssignableFrom()). This works great for Registrar.Register<IFooDAL, FooDAL>(), but how about Registrar.Register<IFoo<int>,Foo<int>>(). Haven’t quite figured that one out yet (or even whether I need to) LongSack fucked around with this message at 02:01 on May 7, 2019 |
# ? May 7, 2019 01:02 |
|
You could probably replace that with a few lines using Dapper
|
# ? May 7, 2019 15:57 |
|
LongSack posted:I don’t use DI (except in ASP.NET) You're doing DI, dude. LongSack posted:An example, my Registrar class checks that the concrete type can actually be returned as an instance of the interface (using IsAssignableFrom()). This works great for Registrar.Register<IFooDAL, FooDAL>(), but how about Registrar.Register<IFoo<int>,Foo<int>>(). Haven’t quite figured that one out yet (or even whether I need to) This is a form of DI. You've created your own DI container, you're registering concretions with abstractions and asking for the abstraction from the container provided as an ambient context. You're like two steps away from making it true DI by just having the registry new up the concrete type and resolve any dependencies it has by checking itself, and adding a "release" operation where you pass the injected service back to the DI Container so it can clean up any disposable dependencies.
|
# ? May 7, 2019 16:43 |
|
LongSack posted:And, yes, I know I could have used “off-the-shelf” components for entity mapping and my “registrar”, but that’s not the point. I’m learning. 99% of software development is knowing when to not reinvent the wheel in the name of learning, and instead learn how to use an off-the-shelf tool so that you can get back to solving problems, instead of solving meta-problems. I'm seeing that this is a recurring pattern with you. You say "I'm trying to solve <problem X> by <reinventing tool Y>". People (me) say "You're reinventing the wheel. Use <tool Y>." You respond with "I'm learning!" It's a pattern we see in the industry all the time, it's called "Not Invented Here", and it's always bad. There's nothing wrong with learning, and there's certainly educational value in reinventing Tool Y to understand how Tool Y might work under-the-hood. But you should ultimately just use Tool Y, because there's almost no chance that you did a better job of solving that specific problem than the person or people responsible for Tool Y.
|
# ? May 7, 2019 19:11 |
|
As a consulting developer I love NIH orgs, because I can roll in and blow their mind with getting something done in one-eighth of the time it would have taken them by using third party libs where they would be spinning their wheels for 4 weeks re-writing JSON.net.
|
# ? May 7, 2019 19:52 |
|
Dietrich posted:As a consulting developer I love NIH orgs, because I can roll in and blow their mind with getting something done in one-eighth of the time it would have taken them by using third party libs where they would be spinning their wheels for 4 weeks re-writing JSON.net. jason dot net is so bad though; i wish someone put in the effort to build a better jason
|
# ? May 8, 2019 02:26 |
|
What's so bad about json.net? I mean I really don't know about anything else besides gson and the built-in python one, but it seems to do the needful pretty quicklike.
|
# ? May 8, 2019 03:11 |
|
dougdrums posted:What's so bad about json.net? I mean I really don't know about anything else besides gson and the built-in python one, but it seems to do the needful pretty quicklike. the thing that makes me groan about json.net are all the stupid dependency issues i've had to deal with involving the library - there was a version of json.net which pulled in 100+ dependencies on different projects in nuget when added to a project. (this is fixed) - json.net had a bunch of releases back in the day that incremented the major version but didn't really change the functionality, and since a lot of loving stuff uses json .net, you might have to deal with library 1 that uses version 6, library 2 that uses version 9, etc. and it all goes to hell if they need to run at the same time. easily fixable with binding redirect, easily detectable using assembly binding logging, but annoying. - while not nearly as bad as the gently caress ups in .net standard, net core has a dependency on specific json.net versions (this is supposed to be fixed in .net 30) i mean you'll probably just end up with the stupid thing as a dependency in your project anyway, it does the job well enough, and the dependency problems are mostly a function of it being a victim of its own success, but man can that poo poo be annoying if something goes wrong.
|
# ? May 8, 2019 04:42 |
|
my favorite issue is this one closed won’t fix where strings that look like datetimes get parsed as datetimes (sometimes incorrectly) with no way to recover the parse string
|
# ? May 8, 2019 10:54 |
|
leper khan posted:my favorite issue is this one closed won’t fix where strings that look like datetimes get parsed as datetimes (sometimes incorrectly) with no way to recover the parse string That's horrible, you should post it in the coding horrors thread
|
# ? May 8, 2019 11:03 |
|
leper khan posted:jason dot net is so bad though; i wish someone put in the effort to build a better jason You might like FSPickler, depending on what you need to do with your jason (read carefully the 'Why FSPickler?' section).
|
# ? May 8, 2019 13:58 |
|
Bruegels Fuckbooks posted:the thing that makes me groan about json.net are all the stupid dependency issues i've had to deal with involving the library leper khan posted:my favorite issue is this one closed won’t fix where strings that look like datetimes get parsed as datetimes (sometimes incorrectly) with no way to recover the parse string quote:@JamesNK could you explain the reasons behind this design? It seems pretty strange to me that a string value should arbitrarily be interpreted as a date just because it looks like a date... @JamesNK posted:Because JSON doesn't have a date format.
|
# ? May 8, 2019 17:32 |
|
(It's open source dudes, send a pull request with the feature you want)
|
# ? May 8, 2019 18:28 |
|
Any PR changing that default behavior is likely to get immediately rejected by the author.quote:I have no plans to change it, and I would do it again if give the chance.
|
# ? May 8, 2019 18:46 |
|
TFW when you mean to write C# but end up writing PHP instead
|
# ? May 8, 2019 19:13 |
|
Yeah I thought about submitting one that just changed the default, but it seemed like a dick move. Still might do it anyways.
|
# ? May 8, 2019 20:48 |
|
leper khan posted:my favorite issue is this one closed won’t fix where strings that look like datetimes get parsed as datetimes (sometimes incorrectly) with no way to recover the parse string That sounds a lot like something Elasticsearch does if you write a new field. It'll guess the type and then the field is that type forever.
|
# ? May 10, 2019 02:23 |
|
gently caress it, CSV for serialization forever.
|
# ? May 10, 2019 04:11 |
|
Does anybody know of a good library to create a text shell console application? I'm talking about having an actual command prompt and commands. I'm feeling particularly lazy about doing this half-assed manually so I hoped there was something nice I could use instead. I found this: https://github.com/janpieterz/CommandRunner But it seems keen on this menu/submenu thing and vomiting out the main menu after each shell command. The pollution from that is going to be very annoying for what I'm trying to do.
|
# ? May 10, 2019 08:00 |
|
Mono.Options is my go-to command line args parser, can't beat it IMO. It was previously called NDesk.Options and this name can get you better docs online still to this day.
|
# ? May 10, 2019 08:22 |
|
A bit different from what I think you're looking for, but check this out: https://github.com/migueldeicaza/gui.cs
|
# ? May 10, 2019 08:58 |
|
EssOEss posted:Mono.Options is my go-to command line args parser, can't beat it IMO. It was previously called NDesk.Options and this name can get you better docs online still to this day. Ahhh I wasn't looking for a command-line argument parser, but a command-line console helper. I was hoping to get something to help me present basic terminal commands like: code:
What's funny with you bringing that up all my searching gets polluted by command-line argument stuff. NihilCredo posted:A bit different from what I think you're looking for, but check this out: https://github.com/migueldeicaza/gui.cs ...lol yes I think I should have been searching for a REPL: https://github.com/piksel/LibREPL
|
# ? May 10, 2019 19:22 |
|
Is anyone using VS2019 having it randomly upcasing the builtin classes, so that string becomes String? Which, of course, VS then tells me that the declaration can be simplified and recommends changing it back to string. It's getting irritating.
|
# ? May 11, 2019 15:54 |
|
LongSack posted:Is anyone using VS2019 having it randomly upcasing the builtin classes, so that string becomes String? Probably obvious, but have you checked your language settings / editorconfig settings? Do you have the Intellicode plugin? I haven't noticed this behavior with 2019 myself.
|
# ? May 12, 2019 21:55 |
|
|
# ? Jun 8, 2024 05:59 |
|
B-Nasty posted:Probably obvious, but have you checked your language settings / editorconfig settings? Do you have the Intellicode plugin? It doesn’t happen all the time, so I don’t think it’s an editor setting, but yeah, I do have Intellicode enabled. That’s probably it. I guess I’ll have to wait and see if the annoyance of this outweighs the utility of intellicode. Thanks.
|
# ? May 13, 2019 00:30 |