* 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. DTOs to DB models).
* RestSharp makes talking to RESTful apis easier.
* Microsoft's Unity is a great IOC framework, although most people seem to use NInject.
I've been using it on most of my newer projects this year and I have to say I much prefer it over the (still excellent) Json.net.
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.
* EPPlus for reading or creating Excel spreadsheets without using Excel (such as on a server). http://epplus.codeplex.com/
* RTFConverter for parsing RTF. http://www.codeproject.com/Articles/27431/Writing-Your-Own-R...
These are good enough to drive the decision to use C#/.NET for projects needing these capabilities.
They also have a great MVC integration
Another interesting library for doing REST APIs is Refit: https://github.com/paulcbetts/refit
Technically, I implemented some of that stuff myself because I needed REST client that would work with PCLs and be a bit 'nicer' to use than just juggling strings/routes everywhere, so using annotations and wrapping Microsoft's HttpClient was obvious and relatively easy way out.
Anyway, I'll probably just phase out my own solution and start using the library.
[EDIT]
After checking it out, RefitStubs.cs file seems a little bit clunky, but the library as a whole looks solid enough. I'll look further into it.
Many things are possible : http://imageresizing.net/
It isn't possible in Asp.Net 5 (vNext) though :( - because of the cross platform integration.
Also, https://github.com/jamietre/CsQuery is pretty nice for parsing webpages and using CSS Selectors (jquery style)
With CsQuery, you could use aBot ( https://github.com/sjdirect/abot ) for crawling ;)
I use ELMAH for logging but I'll give NLog a look!
I use NLog, but I access it through the Common.Logging facade. This is helpful when I need to bolt my code into an environment where NLog kind of sucks, like Xamarin.Android.
Commons.Logging always felt clunky in comparison.
We use Elmah instead of Nlog, which is also fine. Looks like NLog is a bit more flexible than Elmah is. But Elmah is KISS which is nice.
Dapper distills the converting database rows to objects. It's a micro ORM, which means it doesn't try to abstract SQL like a monolithic ORM (NHibernate, EntityFramework) would do. Example:
public TagModel GetTag(long id)
{
using (var conn = m_connector.GetConnection())
{
return conn.Query<TagModel>("SELECT TOP 1 * FROM Tags WHERE Id = @Id", new { Id = id }).FirstOrDefault();
}
}It might not be really clear, sorry. Try to look on their website https://github.com/AutoMapper/AutoMapper/wiki/Getting-starte....
Automapper basically allows you to convert a DB Model to a DTO or a ViewModel.
* albacore for cross platform builds with ruby https://github.com/Albacore/albacore/ C++.Net, VB, C#, F#
* suave.io http://suave.io F#
* logary for structured logging and metrics and health-checks http://logary.github.io/ C# and F#
* Chiron for F# JSON parsing
* logibit.hawk for F# API Hawk verification https://github.com/logibit/logibit.hawk/
* Http.fs instead of RestSharp for F#
* FsSql for ADO.Net interaction
* FluentValidation: excellent validation library, keeps validation rules grouped together and easy to keep track of - https://github.com/JeremySkinner/FluentValidation
* AutoFixture: great for the "Arrange" phase of unit tests. Populates object graphs with test data, highly customizable. There's a bit of a learning curve. Pairs nicely with xUnit but can be used with any TDD library - https://github.com/AutoFixture/AutoFixture
* Shouldly: a different approach to unit test assertions using "Should" that I find more readable. Also had friendlier error messages when assertions failed - https://github.com/shouldly/shouldly
Shameless plug of my own library:
* Regextra: aims to solve some common regex related scenarios. Features a Passphrase Regex Builder to generate a pattern for passphrase criteria, and also supports named templates and a few utility methods - https://github.com/amageed/Regextra
Partially because that's what AutoFixture's maintainer seems to have done recently. Mostly because FsCheck adds a number of additional features such as automatically reducing failing test cases down to the the simplest failing example it can find that make it very powerful for more complex cases.
One downside, though, is that the C# interfaces are somewhat neglected. It's really a lot nicer to use from F#.
* Simple.Data: https://github.com/markrendle/Simple.Data , the smallest and simplest ORM you'll ever use.
* Hyperletter: https://github.com/Jiddler/Hyperletter , a very easy way to do inter-process communication. Great for writing distributed software over http, but can be just as useful locally.
This is a port of the Akka framework from Java to the .Net platform. It's an actor model framework which works incredibly well for building highly concurrent and distributed applications. They just hit version 1.0 and are out of beta and are backed by a commercial company Petabridge.
Highly recommended.
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.
Units.Net I love this for measurement and weight conversions http://www.nuget.org/packages/UnitsNet/
And, of course, a shameless plug of my own library Fibber An indiscriminate data generator that will generate random data for all properties in a given class based on the property's type vs. its name https://github.com/Schandlich/Fibber http://www.nuget.org/packages/Fibber/
I can honestly say I had not heard about AutoFixture until today. Haha.
They look similar. The only difference I can really see is that I prefer my syntax a little better for type fixtures:
.For<string>("whatever"); vs fixture.TypeMappings[typeof(string)] = s => "whatever";
I also allow a seed to be set for ensure "consistent random data".
But there are some features of AutoFixture that I definitely want to look at.
I created Fibber more for mocking data sources when I was creating Web Api services; and AutoPoco was just too much configuration. Unit testing was not the main purpose of the library.
Now you have no excuses for rolling your own broken crypto.
Knowing that'll need some of those libraries later I decided to compile into a list here: https://github.com/tallesl/.NET-libraries
* Do you mean half the performance per connection? * Throughput falls off at half the connections? * Will start trailing off at half the number of servers?
In my mind there's a cost to development time, architecture thinking as well as developer cost to maintain/adapt/enhance. If you can throw more runtime resources at a problem, and that costs you a fraction of a man-year of labor over the next five years vs. taking longer to develop, or fewer developers skilled enough to make modifications, these are real concerns. It really depends on context.
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
}I'm glad to hear you're getting value out of it! Last place I was at, we had about 30 distinct services running. It was a huge bonus to have Topshelf.
Hangfire --------
LGPL3 https://tldrlegal.com/license/gnu-lesser-general-public-lice...
Postal ------
MIT https://tldrlegal.com/license/mit-license#summary
Formo -----
MIT https://tldrlegal.com/license/mit-license#summary
CsvHelper ---------
MS-PL https://tldrlegal.com/license/microsoft-public-license-(ms-p... Apache https://tldrlegal.com/license/apache-license-2.0-(apache-2.0...
Topshelf --------
Apache https://tldrlegal.com/license/apache-license-2.0-(apache-2.0...
This is an extensive list of (non-MS) OSS libs and tools for .NET , complete with descriptions. The URL might suggest this is the .NET source, it's a set of text documents with URLs to OSS libs/tools.
var list = new ObservableCollectionExtended<TradeProxy>();
var myoperation = somedynamicdatasource
.Filter(trade=>trade.Status == TradeStatus.Live)
.Transform(trade => new TradeProxy(trade))
.Sort(SortExpressionComparer<TradeProxy>.Descending(t => t.Timestamp))
.ObserveOnDispatcher()
.Bind(list)
.DisposeMany()
.Subscribe()
This takes the collection at somedynamicdatasource, transforms the contents to TradeProxy objects, sorts it, and binds it to list. Any time that an object is added or removed in somedynamicdatasource, list will be updated to match. This library has over 50 operators including dynamic filters (changing the filter causes the bound collection to be reevaluated), boolean operators (only update the resulting collection if the object is in both source collections or only one), etc.Insight.Database, in my opinion much better than Dapper https://github.com/jonwagner/Insight.Database
T4MVC is a T4 template for ASP.NET MVC apps that creates strongly typed helpers that eliminate the use of literal strings in many places.
[0]: https://github.com/T4MVC/T4MVC* ServiceStack - full-featured Services Framework https://github.com/ServiceStack/ServiceStack
* ServiceStack.OrmLite - Fast, Simple, Typed ORM for .NET https://github.com/ServiceStack/ServiceStack.OrmLite
* BCrypt.Net - A .Net port of jBCrypt implemented in C# http://bcrypt.codeplex.com/
* Stripe.net - .net api for Stripe https://github.com/jaymedavis/stripe.net
* TuesPechkin - .NET Wrapper for the wkhtmltopdf library (to generate PDFs) https://github.com/tuespetre/TuesPechkin
* RestfulRouting http://restfulrouting.com/ - must have
* Turbolinks for .net https://github.com/kazimanzurrashid/aspnetmvcturbolinks
* Flash messages for .net https://github.com/khalidabuhakmeh/MvcFlash
* Fixie, unit testing https://github.com/fixie/fixie
* Entity Framework testing tool http://effort.codeplex.com/
* Automapper, AutoFixture, FluentValidation - mentioned already
* StructureMap - IoC
I've found some different options including Lokad, NServiceBus, MassTransit, MPAPI, but would love to hear what, if any, tools HN users are utilizing.
- SpecsFor: Some nice BDD wrappers around NUnit and Moq http://specsfor.com/ - Glimpse: A great diagnostic console tool for ASP.NET applications http://getglimpse.com/ - FluentMigrator: Awesome DB migration framework https://github.com/schambers/fluentmigrator
Last summer and into the fall, I had plans for Formo 2.0, which included a lot more flexibility and customization capabilities (json config, http context config, environment variables, etc). When I learned about aspnet5's configuration I essentially stopped development on Formo. The big reason being that they're building in such a way that I imagined Formo would be used. (Which makes me quite happy)
For that reason, the project is largely "finished", but it's still stable and alive.
Lots of cool/useful open source projects are always popping up in the F# community - http://fsharp.org/community/projects/
Favs of mine from that list: Visual F# Power Tools, FSharp.Data.SqlClient, FsEye, Fantomas, R type provider
* Hangfire(http://hangfire.io/): for background jobs.
* Polly(https://github.com/michael-wolfenden/Polly): For exception handling policies.
Edit: formatting.
FastJSON is my favorite non JSON.NET Json serializer.
Don't be put off by the dated SourceForge location. It is pure awesome for getting data in and out of CSV format.
* AutoMapper is a great mapper, but too slow http://automapper.org/
* TinyMapper is extremely quick http://tinymapper.net/
I use Hangfire and then simply have Azure Scheduler ping my site regularly.