|
If one wanted to create a multi-user LOB application, with a central server and windows desktop clients, which .NET tools would you use these days?
|
# ? May 15, 2019 21:48 |
|
|
# ? Jun 8, 2024 01:06 |
|
epalm posted:If one wanted to create a multi-user LOB application, with a central server and windows desktop clients, which .NET tools would you use these days? An HTTP API for the server, ASP.NET Core. Because I'd give it a 95% chance that you'll be asked to make a web or non-Windows client within five years, so it's not worth it to use anything else. Use OpenAPI to autogenerate a .NET client from a server, or a client and a server stub from a spec. Make the autogeneration part of your CI. Keep the API server fully stateless and run job queues and assorted services in a separate process accessing the same data store. For the desktop client, currently WPF, but I'd be keeping a real close eye on the Xamarin.Forms previews that can run on desktop (WPF and GTK# backends). F# on both sides, because data integrity and catching corner cases is king in LOB apps, and once you're past the initial onboarding process F# has the better tools for that.
|
# ? May 15, 2019 22:25 |
|
epalm posted:If one wanted to create a multi-user LOB application, with a central server and windows desktop clients, which .NET tools would you use these days? Or just use electron or something for the client anyway even though the clients are all running windows.
|
# ? May 15, 2019 22:26 |
|
NihilCredo posted:An HTTP API for the server, ASP.NET Core. Because I'd give it a 95% chance that you'll be asked to make a web or non-Windows client within five years, so it's not worth it to use anything else. Use OpenAPI to autogenerate a .NET client from a server, or a client and a server stub from a spec. Make the autogeneration part of your CI. I'll second this.
|
# ? May 15, 2019 23:19 |
|
NihilCredo posted:An HTTP API for the server, ASP.NET Core. Because I'd give it a 95% chance that you'll be asked to make a web or non-Windows client within five years, so it's not worth it to use anything else. Use OpenAPI to autogenerate a .NET client from a server, or a client and a server stub from a spec. Make the autogeneration part of your CI. I'm thirding this and also seconding electron. I'd need a really, really, really good business case to build something that wasn't immediately portable to the web in 2019. And even then, they're probably wrong.
|
# ? May 15, 2019 23:41 |
|
And what would you use to allow the central server communicate with the clients? I.e. I save a record over here, I want all other clients to see the change, without polling. MSMQ? SignalR? Something else?NihilCredo posted:An HTTP API for the server, ASP.NET Core. Because I'd give it a 95% chance that you'll be asked to make a web or non-Windows client within five years, so it's not worth it to use anything else. Use OpenAPI to autogenerate a .NET client from a server, or a client and a server stub from a spec. Make the autogeneration part of your CI. Assuming Windows, where does ASP.NET Core run? IIS? Hostable Web Core? Something else? NihilCredo posted:Keep the API server fully stateless and run job queues and assorted services in a separate process accessing the same data store. Assuming Windows, where does the separate "job queue" process run? Windows Service? Something else? epswing fucked around with this message at 16:53 on May 16, 2019 |
# ? May 16, 2019 16:50 |
|
epalm posted:Assuming Windows, where does ASP.NET Core run? IIS? Hostable Web Core? Something else? IIS In-Process (Core >=2.2) is your best option here. Especially now that MS reversed their stupid decision to use Kestrel and a hacky reverse proxy. epalm posted:Assuming Windows, where does the separate "job queue" process run? Windows Service? Something else? Windows Service is still the best option now with the Windows Compatibility Pack. Win Services have a small learning curve, but they're pretty simple and powerful. There was never any need for garbage like TopShelf, which over-complicates a pretty simple model. I'm a big proponent of using Azure Service Bus for your queue needs. It's dirt cheap, and has a ton of nice features and a easy Nuget package library to use it. MSMQ is probably not going to be supported in Core, and it's old, hard-to-administer, and full of footguns.
|
# ? May 16, 2019 17:06 |
|
epalm posted:MSMQ? SignalR? Something else? Having used MSMQ and RabbitMQ at the same job, I'd say stay away from MSMQ and consider Rabbit.
|
# ? May 16, 2019 17:14 |
|
Munkeymon posted:RabbitMQ Also a very good option if you need/want to manage your own messaging/queue infrastructure. I'd still recommend AzureSB in cases where using cloud stuff is allowed. The basic level should cost you less than a few dollars a month, and the 'standard' level is about $10/month (assuming always on) and includes topics and other advanced functionality. Self-hosting Rabbit with redundancy may end up costing more in time+hardware costs.
|
# ? May 16, 2019 17:20 |
|
epalm posted:And what would you use to allow the central server communicate with the clients? I.e. I save a record over here, I want all other clients to see the change, without polling. MSMQ? SignalR? Something else? You could use websockets for the pushing of data to the clients without polling. Kafka would also be an option. ASP.Net could run on kestrel with a reverse proxy in front. Or you could use kerstrel on IIS. Or Giraffe or Suave if you want use F#. For the jobqueue you could use a Windows service or just a regular process that runs on the server. Loads of options really.
|
# ? May 16, 2019 20:16 |
|
B-Nasty posted:Windows Service is still the best option now with the Windows Compatibility Pack. Win Services have a small learning curve, but they're pretty simple and powerful. There was never any need for garbage like TopShelf, which over-complicates a pretty simple model. Azure Function is also a cromulent option if you want to go in a stateless microservice direction. You get servicebus triggers, auto-scaling, etc without having to reinvent the wheel.
|
# ? May 16, 2019 21:20 |
|
epalm posted:And what would you use to allow the central server communicate with the clients? I.e. I save a record over here, I want all other clients to see the change, without polling. MSMQ? SignalR? Something else? SignalR over websockets is probably a better choice than plain WSs. It has an official Typescript library anyway so it doesn't restrict your future inevitable web move. It also acts as a wrapper over some of websockets' more dangerous quirks. Message queues exist to not lose messages, not to push them. You may or may not need them (fart popups no, price changes yes), and use them with or without a push library like SignalR. quote:Assuming Windows, where does ASP.NET Core run? IIS? Hostable Web Core? Something else? The real answer here is 'whatever the guy who may need to answer the phone at 2AM because the server is down knows best'. As a developer, I push for Docker whenever possible because it makes the deployment story super easy, and there's plenty of monitoring / healthcheck type tools to make the people in charge of operations happy as well (even without going full retard with orchestration and whatnot). But if my boss, a dyed-in-the-wool Windows dude, told me that this was a small project and he'd be the one answering 2 AM calls, I'd probably hand him a powershell to start the ASP.NET Core app as a Windows service so he can janitor it as he likes.
|
# ? May 16, 2019 21:28 |
|
B-Nasty posted:I'd still recommend AzureSB in cases where using cloud stuff is allowed. The basic level should cost you less than a few dollars a month, and the 'standard' level is about $10/month (assuming always on) and includes topics and other advanced functionality. Self-hosting Rabbit with redundancy may end up costing more in time+hardware costs. Of all the Azure infrastructure pieces I use at work, Service Bus is probably the best of them (Cosmos DB is pretty good too, in spite of its stupid name). Would definitely concur with this. The one thing that is moderately lacking is official tooling for it, though you can do simple stuff in the Azure Portal, and the third party Azure SB Explorer is good enough to do all we need.
|
# ? May 16, 2019 22:45 |
|
New Yorp New Yorp posted:Azure Function is also a cromulent option if you want to go in a stateless microservice direction. You get servicebus triggers, auto-scaling, etc without having to reinvent the wheel. I know the official Microsoft party line is that they've greatly improved speed, but have you found this to be true? I did some basic testing with Azure Functions a year or so ago, and the performance was absolutely pitiful. Everything I could measure was abysmal: spin up time, execution time, etc. Running a basic VM in Azure with a Service/Console app was hundreds of times faster, and not significantly more expensive. Of course, redundancy is DIY.
|
# ? May 17, 2019 01:07 |
|
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 I feel like an idiot, because this seems correct to me. JSON has no way to specify datetime types and everything is a string unless it's a number or a Boolean. It looks like JSON.net is reading in the string, parsing it as a datetime and setting it to the correct timezone. What's the problem?
|
# ? May 19, 2019 12:19 |
|
Oh poo poo I just reread and I did misunderstand. The above will remain as a testament to my own inability to read and parse strings, much like the library I was defending.
|
# ? May 19, 2019 12:22 |
|
Bit of a meta question rather than a .NET question. I'm using a CQRS pattern for a new project and I'm curious what people thinking regarding where the line should be for a command. Are commands supposed to be specifically for dealing with database mutations? For example if I want to send an email and then log it to the database, would I used some kind of communication facade to send the email AND call a command that persists the email message to the database? Or does it make sense to have the command send the email within its handler AND persist it to the database? Obviously both would work, but I'm curious what people's opinions are around this. My instinct is telling me that commands are really just for interacting with the database not for business logic. For business logic a facade can be made that will leverage commands to perform larger units of work. Thoughts? Am I on the wrong track completely here?
|
# ? May 20, 2019 23:45 |
|
Commands update state in your aggregates ( this could mean a DB, but it does not have to be ), sending an email sounds like something that happens because of a trigger somewhere else. Sending an email sounds to me like something that happens because of a previous command has updated the state of some entity and it needing to tell the world about it. The command could be sendPasswordResetEmail, it updates the entity in the aggregate ( a security principal perhaps? ) with a flag that it needs to send an email and stores the command as sentPasswordResetEmail. It updates the readmodel with this flag and there might be a job system that runs on these tables sending every person an email where the flag is set and storing the email somewhere and issuing a new command to the aggregate that it has done so. This has the added benefit, if you use something like eventsourcing, that you can replay the commands without actually sending the emails ( disable the job system when rebuilding the aggregates, otherwise people might receive the email again). Before the command does its stuff it should have been validated by your business rules ( is every field filled in etc. etc. ). All IMHO of course. Mr Shiny Pants fucked around with this message at 07:40 on May 21, 2019 |
# ? May 21, 2019 07:34 |
|
B-Nasty posted:Especially now that MS reversed their stupid decision to use Kestrel and a hacky reverse proxy. Oh huh what happened now?
|
# ? May 22, 2019 22:11 |
|
EssOEss posted:Oh huh what happened now? You can host .NET Core 2.2+ apps in-process on IIS itself instead of the .NET Core app running on a Kestrel host with IIS acting as a proxy forwarding requests to it. When I say "you can" I mean "you should" unless you've got multiple .NET Core apps running behind a single IIS proxy (you should not do this).
|
# ? May 22, 2019 23:14 |
|
Munkeymon posted:RabbitMQ I cannot say enough good things about NServiceBus. It's amazing.
|
# ? May 23, 2019 01:11 |
|
karma_coma posted:I cannot say enough good things about NServiceBus. It's amazing. Is this because you used RMQ in the past and it sucks? Just curious. I've had less than stellar experiences with RMQ in the past myself but everything else I found was much worse in some regard.
|
# ? May 25, 2019 19:55 |
|
Protocol7 posted:Is this because you used RMQ in the past and it sucks? Just curious. I've had less than stellar experiences with RMQ in the past myself but everything else I found was much worse in some regard. NServiceBus isn't just another message queue, it's more a library implementing message bus patterns, and you can use RabbitMQ as the transport (or kafka/ msmq/ whatever). If you just use the .NET rabbitmq driver you're probably just going to end up with your own lovely version of nservicebus anyway.
|
# ? May 25, 2019 20:42 |
|
Ever use MassTransit, if so any thoughts on how they compare?
|
# ? May 25, 2019 21:38 |
|
Bruegels Fuckbooks posted:NServiceBus isn't just another message queue, it's more a library implementing message bus patterns, and you can use RabbitMQ as the transport (or kafka/ msmq/ whatever). If you just use the .NET rabbitmq driver you're probably just going to end up with your own lovely version of nservicebus anyway. Yeah, my experience with it was definitely using it just as a message bus, so that makes sense. I don’t work at that company anymore so I can’t make any recommendations but now I know for next time.
|
# ? May 25, 2019 23:12 |
|
I am trying to do ASP.NET core web site that will run on Linux (specifically, Centos). People say to use Docker. So I installed Docker on my server, no problem. Then I go to install Docker Desktop on my development machine (Windows 10) and I see that it requires Hyper-V. I can't enable Hyper-V because I need to run VMWare Workstation for work. So is there a good way to deploy a Docker container without having Docker Desktop? Like do my development using Chrome or whatever, and when I'm ready to publish somehow get it into a Docker image? If not, is there another deployment strategy / tool that is good to use? TIA
|
# ? May 27, 2019 18:37 |
|
You could run docker in a linux VM instead, with a mount pointing at your project. The only other, option, to work on docker locally, is to flip between Hyper-V and VMWare with a reboot. You could also use CI to build the image on commits/certain tag patterns. There are tons of options for that.
|
# ? May 27, 2019 18:50 |
|
LongSack posted:I am trying to do ASP.NET core web site that will run on Linux (specifically, Centos). People say to use Docker. So I installed Docker on my server, no problem. Then I go to install Docker Desktop on my development machine (Windows 10) and I see that it requires Hyper-V. I can't enable Hyper-V because I need to run VMWare Workstation for work. You can try getting Docker running via VMWare, some searching revealed https://medium.com/@ans_ashkan/how-to-use-docker-on-windows-using-vmware-workstation-without-hyper-v-83b3449fe07d Otherwise you could not worry about using Docker in local development, and just produce an image for production deployment as part of a CI pipeline using a service like CircleCI, AppVeyor, etc https://circleci.com/blog/how-to-build-a-docker-image-on-circleci-2-0/ The latter is something you'd probably want to set up on any sizable project regardless of your development environment. E:F,B
|
# ? May 27, 2019 18:56 |
|
Thanks! I'm not close to deployment yet, but i'll check those links out. Another question: Both of the books I'm using for reference refer to Bower for client-side library management. Bower is dead and gone, so I tried to install Bootstrap with the NuGet Package Manager using the "Install-Package bootstrap" command. It appeared to work (i.e, the NuGet Dependencies have references to bootstrap, jquery and popper), but it didn't actually copy the libraries anywhere. So what exactly did it do? Note that I found the "Add -> Client-Side Library" menu option and was able to install bootstrap locally using that, but I still have no idea what the NuGet Package Manager did or thinks it did. When I use it for desktop apps, it copies the libraries locally.
|
# ? May 27, 2019 19:18 |
|
Nevett posted:You can try getting Docker running via VMWare, some searching revealed https://medium.com/@ans_ashkan/how-to-use-docker-on-windows-using-vmware-workstation-without-hyper-v-83b3449fe07d I would try this first, and if it doesn't work, you can install the old Docker Toolbox which runs on Virtualbox instead of Hyper-V. It's obsolete but still works quite fine for development. If you're on the Insiders release schedule, a month from now you'll be able to install the first builds of WSL 2 which will support Docker.
|
# ? May 28, 2019 06:53 |
|
LongSack posted:Thanks! I'm not close to deployment yet, but i'll check those links out. If you use VS Code you can use the docker extension and connect to a remote Docker host. This way you don't need a local Docker daemon.
|
# ? May 28, 2019 09:53 |
|
I need to know what PDF library will let me easily generate my own PDFs in .NET (mostly just compositing a few images and adding some text regions, though later I'll want to combine multiple existing single page PDFs into one big one...) UI Project is Framework 4.7 (WPF) and my Model is Core 2.0 - so obviously native C# solutions preferred IronPDF had the best looking web site, but this iTextSharp NuGet package has the most downloads, though PDFsharp isn't far behind it... ugh I wish It was easier to see licensing information from the NuGet manager.
|
# ? May 28, 2019 17:38 |
|
NihilCredo posted:I would try this first, and if it doesn't work, you can install the old Docker Toolbox which runs on Virtualbox instead of Hyper-V. It's obsolete but still works quite fine for development. WSL 1 and 2 require Hyper-V. edit: maybe 1 doesn't, but 2 does.
|
# ? May 28, 2019 19:29 |
|
roadhead posted:I need to know what PDF library will let me easily generate my own PDFs in .NET (mostly just compositing a few images and adding some text regions, though later I'll want to combine multiple existing single page PDFs into one big one...) Does it have to be free, or are paid-for products acceptable? We use DynamicPDF for some stuff at work and it's ok for what we do, but it costs money. No idea whether they've released it as .NET Standard/.NET Core, and I haven't tried anything else for comparison.
|
# ? May 28, 2019 21:16 |
|
Hammerite posted:Does it have to be free, or are paid-for products acceptable? Free isn't a requirement, but it does need to SHIP in my software that people install on their machines, so I'd have better luck getting approval for something that has a one time cost instead of a licensing model where we have to pay per instance.
|
# ? May 28, 2019 22:45 |
|
I’ve used Ibex to generate PDFs. Its libraries are .Net Framework and there’s a prototype in .Net Core available now. https://www.xmlpdf.com you write in xsl-fo and then use xslt to transform into pdfs. So a bit different to writing the document in c# against a library but you can ship the libraries with your application. The support is pretty incredible though. I was working on upgrading our version to one where they changed their svg engine and was submitting bug reports and they’d deploy a fix within 24hrs most of the time.
|
# ? May 28, 2019 23:42 |
|
I've used PDFsharp in the past but have no idea how well it's aged into the -core era.
|
# ? May 29, 2019 00:36 |
|
roadhead posted:Free isn't a requirement, but it does need to SHIP in my software that people install on their machines, so I'd have better luck getting approval for something that has a one time cost instead of a licensing model where we have to pay per instance. ??? It is a one-time cost, as far as I understand it. You buy one of the "developer" licenses and you can develop applications with it and distribute them without requiring the end user to purchase licenses. If it doesn't work like that then my company is doing it wrong (!)
|
# ? May 29, 2019 00:45 |
|
Somehow, every single PDF library I looked at was janky in one way or another. I ended up just writing my own PDFs. The PDF file format is easy, and it worked out quicker for me to figure out how to construct the PDF than it was to learn an idiosyncratic PDF library. (This approach seems fine for simple things like positioned text and lines. Once you start wanting to freely flow paragraphs or draw complicated graphics, then I'm sure a fancier PDF library will be necessary). code:
|
# ? May 29, 2019 04:01 |
|
|
# ? Jun 8, 2024 01:06 |
DI question, I'm using SimpleInjector to set up my application. Now I need to have a dynamic configuration, depending on a configuration setting I'd like to supply a different object for a specific interface. I think. I'd like to have an IUserIdentitySupplicant, usually fulfilled by an AutoDetectIdentitySupplicant, but the installer should be able to set a setting that would select a FixedIdentitySupplicant that doesn't dynamically detect and supply identity data, just having a static result. Does this sound like the right approach, and what would be the pattern to implement this?
|
|
# ? May 29, 2019 14:33 |