Open Source .NET libraries that make your life easier
31–40 of 116 posts
Re: Open Source .NET libraries that make your life easier
#32As an alternative to CsvHelper I can recommend FileHelpers by Marcos Meli: http://filehelpers.sourceforge.net/ Don't be put off by the dated SourceForge location. It is pure awesome for getting data in and out of CSV format.
Re: Open Source .NET libraries that make your life easier
#33As an alternative to CsvHelper I can recommend FileHelpers by Marcos Meli: http://filehelpers.sourceforge.net/ Don't be put off by the dated SourceForge location. It is pure awesome for getting data in and out of CSV format.
Re: Open Source .NET libraries that make your life easier
#34As an alternative to CsvHelper I can recommend FileHelpers by Marcos Meli: http://filehelpers.sourceforge.net/ Don't be put off by the dated SourceForge location. It is pure awesome for getting data in and out of CSV format.
How well does it handle the oddball cases? Not that you could call CSV a rigorously-defined spec, but we have a vendor that sends us a file where they sometimes don't escape double-quotes correctly.
Re: Open Source .NET libraries that make your life easier
#35To add to the author's list: * I seem to install Json.net in every .NET project I create (json serializer - thanks James Newton-King!) * NLog for logging. It's fantastic. * Dapper is also excellent (Micro ORM) (and anything written by Marc Gravell is generally top-notch - see protobuf-net, miniprofiler, StackExchange.Redis) * Automapper, to avoid writing boilerplate code to convert between similarly shaped types (E.G…
Was going to post Dapper, Automapper and RestSharp myself. I use ELMAH for logging but I'll give NLog a look!
Re: Open Source .NET libraries that make your life easier
#36TopShelf looks interesting, I have written quite a few Windows services over the years and there have always been lots of gaps in the MS offering.
I've just rolled out a service using TopShelf having not used it previously. It really does simplify things. The best bit for me is being able to just hit F5 and having the thing run as a console application. No need to manually attach to processes for debugging.
In your Main method:
if (args.Length > 0 && args[0] == "-a")
{
// Running as an application
MyService ms = new MyService();
ms.DoStart();
Console.WriteLine("Press Enter to Stop");
Console.ReadLine();
ms.DoStop();
} else {
// Running as a service
ServiceBase[] servicesToRun = { new MyService() };
ServiceBase.Run(servicesToRun);
}
And in the MyService class that derives from ServiceBase: protected override void OnStart(string[] args)
{
DoStart();
}
protected override void OnStop()
{
DoStop();
}
internal void DoStart()
{
// Start your service thread here
}
internal void DoStop()
{
// Tell your service thread to stop here
}Re: Open Source .NET libraries that make your life easier
#37Earlier quoted context omitted.
I think you're asking about Dapper (ORM) which could be compared to Entity Framework. The two major things to think about if comparing would be simplicity and speed. Dapper is simple to setup and use. It uses standard SQL and it's very fast. On the other hand, this is not a fair comparison. EF is has many more features and options. Use the right tool for the right job depending on requirements. Elmah and NLog are not…
In fact it is not uncommon for me to use both Dapper and EF on the same project. Usually I'll use Dapper for the query/reporting side and EF for the domain model/update side. (Used to use nHibernate, but it seems to have really stagnated unfortunately)
On the other side, if you need to work extensively with stored procedures or you have complicated or custom SQL to run, Dapper (or Insight.Database - https://github.com/jonwagner/Insight.Database, a library which I found really nice to use) will be your best friend.
Re: Open Source .NET libraries that make your life easier
#38I used to use NLog for logging until I've discovered Serilog ( http://serilog.net/ ) - simple .NET logging with fully-structured events.
I'm a bit torn because ETW is prob the way forward for us but it doesn't have a good ecosystem currently and offers nothing like log context... Though some higher order function magics might help.
Re: Open Source .NET libraries that make your life easier
#39Surprised no one has mentioned Nancy: https://github.com/NancyFx/Nancy I can't imagine building APIs without it now.
I find NancyFX really interesting, but I can't really see a reason to stray away from Web API2 besides Mono support. Any specific reasons you prefer Nancy?
Re: Open Source .NET libraries that make your life easier
#40To add to the author's list: * I seem to install Json.net in every .NET project I create (json serializer - thanks James Newton-King!) * NLog for logging. It's fantastic. * Dapper is also excellent (Micro ORM) (and anything written by Marc Gravell is generally top-notch - see protobuf-net, miniprofiler, StackExchange.Redis) * Automapper, to avoid writing boilerplate code to convert between similarly shaped types (E.G…
Autofac is my favorite. Once built, containers are immutable, there is deterministic disposal of components in 'lifetime scopes', and delegate factories make it much easier to instantiate classes with a mixture of services and data.