Previous posts:
Package of the week: Command Line Parser Library
Command-line applications typically accept arguments and options, and expose a --help
page describing them. Parsing those arguments and options is a repetitive task that .NET provides little help for out of the box, beyond the string[] args
argument to main
. Giacomo Stelluti Scala‘s Command Line Parser Library offers CLR applications a clean and concise API for manipulating command line arguments and related tasks, such as defining switches, options and verb commands. It allows you to display a help screen with a high degree of customization and a simple way to report syntax errors to the end user. Everything that is boring and repetitive about parsing command line arguments is delegated to the library, letting developers concentrate on core logic. It’s written in C# and doesn’t depend on other packages. It’s also friendly to F# and VB developers.
First, define the options the application expects:
class Options {
[Option('r', "read", Required = true,
HelpText = "Input files to be processed.")]
public IEnumerable<string> InputFiles { get; set; }
// Omitting long name, default --verbose
[Option(
HelpText = "Prints all messages to standard output.")]
public bool Verbose { get; set; }
[Option(Default = "中文",
HelpText = "Content language.")]
public string Language { get; set; }
[Value(0, MetaName = "offset",
HelpText = "File offset.")]
public long? Offset { get; set; }
}
Then consume them:
static int Main(string[] args) {
var options = new Options();
var isValid = CommandLine.Parser.Default.ParseArgumentsStrict(args, options);
User group of the week: .NET South East (Brighton, UK)
User groups are an essential part of the .NET Community, and none of them has existed forever. The creation of a new user group is an occasion for celebration. Steve Gordon, a regular of this column, did just that, and created the .NET South East user group in Brighton in the United Kingdom. I really like that Steve didn’t stop there, and went on explaining why and how he created the group in a great blog post. Hopefully, this can inspire others in the .NET community to create their own group: if there’s no user group in your area, but you know the users are there, just go ahead and fill that void!
- Announcing .NET South East,a new Brighton based .NET User Group, by Steve Gordon.
.NET
- .NET Framework July 2017 Security and Quality Rollup by Rich Lander.
- Samsung Releases 4th Preview of Visual Studio Tools for Tizen including support for .NET Core 2.0 Preview by Scott Hunter.
- .NET Core Design Reviews: System.IO.Pipelines by Immo Landwerth.
- Docker for .NET Developers (Part 7) – Setting up Amazon EC2 Container Registry by Steve Gordon.
- Calling a custom executable from Cake using StartProcess and ProcessSettings by Jeremy Lindsay.
- How to build a .NET Core Project with VS Code ? by Joffrey Kern.
- Good citizenship – logging from .NET libraries by Nicholas Blumhardt.
- Dotnet new templates for AWS Lambda and Raspberry Pi by Carlos Mendible.
- dotnet CLI – how to update a NuGet package and add a new NuGet package by Ibrahim Šuta.
- Introducing Unity 2017 by Alex Lian.
- Introduction to MSBuild in .NET Core by Nate McMaster.
- Live coding an Alexa Smart Home skill from scratch in C# by Damian Mehers.
- Making any call to a function of an object thread safe by Andrei Ignat.
- Use this helper CLI for switching .NET Core SDK versions by Fanie Reynders.
- .NET Core on Circle CI 2.0 using Docker and Cake by Adam Hathcock.
ASP.NET
- Injecting content into your head or body tags via dependency injection using ITagHelperComponent by Joseph Woodward.
- An Angular 4 .Net Core Application Updater by Michael Washington.
- Creating custom password validators for ASP.NET Core Identity by Andrew Lock.
- Minimal ASPNET Core Web API by Steve Smith.
- Building Reusable UI Components in ASP.NET Core by Scott Addie.
- Set User identity and IsAuthenticated in ASP.NET MVC Core controller tests by Hrvoje Hudoletnjak.
- Setting up Webpack in ASP.NET Web Forms by Cecil Phillip.
- How to get the correct Request.Url when behind a load balancer by Simone Chiaretta.
- Development time IIS support for ASP.NET Core Applications by Sourabh Shirhatti.
- Adding an external Microsoft login to IdentityServer4 by Damien Bowden.
- Implementing Two-factor authentication with IdentityServer4 and Twilio by Damien Bowden.
- ASP.NET Core MVC – Form Tag Helpers by Ibrahim Šuta.
- Use brotli compression with ASP.NET Core by Gérald Barré.
- Anti-Forgery Validation in ASP.NET Core by Dino Esposito.
- A guide to caching in ASP.NET Core by Paul Hiles.
- ASP.NET Core Demystified – Model Binding in MVC by Matthew Jones.
- Test Automation Using Atata: Handle Confirmation Popups by Yevgeniy Shunevych.
- Blazor Brings .NET Back to the Browser by InfoQ.
C#
- Revisions to previous discussion of the implementation of anonymous methods in C# by Raymond Chen.
- Join Null Check with Assignment by Colin Angus Mackay.
- Pattern Matching In C# by Sandeep Shekhawat.
- Ref, Ref Return and Ref Local In C# by Sandeep Shekhawat.
- Using Span by Adam Sitnik.
- Using C# 7.1 by Julien Couvreur.
- C# Developers: Stop Calling .Result by James Montemagno.
- Practical C# – Async Main in C# 7.1 by Andrea Angella.
- All you need to know to master C# 7 by Andrea Angella.
- Practical C# – Generalized Async Return Types in C# 7 by Andrea Angella.
- Practical C# – Readonly Auto Properties by Andrea Angella.
F#
- Kami 2 Solver in F# – Part 2 by Chris Smith.
- How does OO look in F#? by Edgar Sánchez.
- From JavaScript to Functional Web Development (part 2) by Sandor Szaloki.
- Intro your website in WebSharper by Sandor Szaloki.
- A gentle introduction to functional programming for web programmers using F# by Lee Stott.
- Microsoft Reiterates its Support of F# by InfoQ.
- Introduction to F# with Nikhil Barthwal by Nikhil Barthwal via NYC F# meetup.
There is more content available this week in F# Weekly. If you want to see more F# awesomeness, please check it out!
Xamarin
- Visual Studio Tools for Tizen by Gunnar Peipman.
- Xamarin forms Tabbed page – UWP with images by Glenn Versweyveld.
- The Xamarin Live Player Unpacked by Sam Basu.
- Generate pdf documents for iOS, Android & Windows UWP using Xamarin Forms and Syncfusion Essentials–Part 2 by Malcolm Jack.
- Mobile Cross Platform Image manipulation with Xamarin (Android / iOS / Windows UWP) by Malcolm Jack.
- Learning Xamarin.Forms – Part 2: MVVM by Jesse Liberty.
- Bind to Xamarin Picker but only update value after hitting Done on iOS by Pieter Nijs.
- Mocking and Unit Testing the Xamarin.Forms Application class by Brian Lagunas.
- Xamarin.Basics – Ad Hoc iOS Builds, Part 2a: Publishing in HockeyApp by Alex Dunn.
- Difference between Xamarin.Forms and Xamarin Traditional by Almir Vuk.
- Getting fancy with UIView anchors and state changes by Diego Ponce de León.
- UIStackView magic by Diego Ponce de León.
- Beta Release: 15.3 Preview 4 by Bri Brothers.
- Step by step tracking down a macOS Beta regression by Chris Hamons.
- Episode 26: Monetizing Mobile Apps with Ads by The Xamarin Show.
- Things I Think Are Cool: Behaviors Library by Matthew Soucoup.
- XAML Markup Extensions by Matthew Soucoup.
- Mastering the Android Support Libraries by James Montemagno.
- Xamarin Podcast: App Monetization, .NET Standard, Azure Cosmos DB, and more! by Pierce Boggan.
- Urban Refuge’s Refugee Aid Mobile Apps Turn Research into Action by Lacey Butler.
- Prism in Xamarin Forms Step by Step (Part. 1) by Charlin Agramonte.
Azure
- How to Store Secrets in Azure Key Vault Using .NET Core by humankode.
- Monitoring the Nuget feed using Azure Functions by Brandon H.
- Azure Data Lake authentication options for .NET by Matthew Hicks.
- Media Services: Integrating Azure Media Services with Azure Functions and Logic Apps by John Deutscher.
- Service Fabric .NET Quickstart by Mikkel Hegnhoj.
UWP
- Windows 10 SDK Preview Build 16232 Released by Clint Rutkas.
- Announcing Babylon.js 3.0 by David Catuhe.
- The UWP Community Toolkit is 1 1/2! (v1.5) by Channel 9.
- Building a dynamic floating clickable menu for HoloLens/Windows MR by Joost van Schaik.
Data
- Reviewing Resin Part I, Part II, and Part III by Ayende Rahien.
Game development
- [Video] 12.7 Unity Tower defense tutorial – Buying upgrades by inScope Studios.
- [Video] Basic Level Design with Unity Terrain Generation by Infallible Code.
- Calling all game devs: The Dream.Build.Play 2017 Challenge is Here! by Andrew Parsons.
And this is it for this week!
Contribute to the week in .NET
As always, this weekly post couldn’t exist without community contributions, and I’d like to thank all those who sent links and tips. The F# section is provided by Phillip Carter, the gaming section by Stacey Haffner, the Xamarin section by Dan Rigby, and the Azure and UWP section by Michael Crump.
You can participate too. Did you write a great blog post, or just read one? Do you want everyone to know about an amazing new contribution or a useful library? Did you make or play a great game built on .NET?
We’d love to hear from you, and feature your contributions on future posts. Please add your posts, it takes only a second.
We pick the articles based on the following criteria: the posts must be about .NET, they must have been published this week, and they must be original contents. Publication in Week in .NET is not an endorsement from Microsoft or the authors of this post.
This week’s post (and future posts) also contains news I first read on The ASP.NET Community Standup, on Weekly Xamarin, on F# weekly, and on The Morning Brew.