aspnetcore

A 28-post collection

dotnet CLI Tab completions now available in 2.0

Tab completion on the command line is like having a superpower for some of the CLI tools we have at our fingertips. With so many commands, paramaters and/or options; it's nice to be able to type a few characters and tap the {Tab} key and get some help. I've gotten spoiled even with directory searching by just hitting tab now in zsh and having the list popup and getting the "pick list" to choose the right one. A long standing issue for the .NET CLI for the command line lovers was this missing feature. Wait no longer, with the 2.0 release you can now enable it with by adding some config to your .bashrc, .zshrc or even Powershell...


Don't lose your swagger with dotnet build

See GitHub Issue #795 for the details and discussion. One of the undocumented changes of converting from project.json to csproj, was the <DocumentationFile> no longer automatically copied to the output folder during the build or publish process. There have been multiple solutions, both pre and post publish scripts. However, understanding how MSBUILD works and finding the simplest way is key. Thanks to Eric Erhardt's latest comment here I think that this is the cleanest way. Add the following snippet to the .csproj to enable the copy of the documentation file to the output folder. It supports the F5 options as well as the dotnet build / dotnet publish CLI commands. Another important option tested was the ability to...


Simplifying Bundling and Minification in ASP.NET Core

The decisions around what to use for packaging client side libraries is still a length discussion. Mostly, if not always, will start and stop with "It Depends...". However, getting started with something and being able to build upon that is a good starting point rather than what some call "Paralysis through analysis". Bundler & Minifier When this component was originally available, only Visual Studio 2015 / 2017 users could take advantage through the use of an extension (VSIX) or you could use dotnet bundle by adding a dotnet tools CLI package to your project. Now, in the recent update, the NuGet package fully integrates with MSBuild and you can take advantage of using the bundling and minify capabilities as a part...


Documenting ASP.NET Core WebAPI using Swagger

When you create a web API, documenting its capabilities for the consuming developers can be a task if you take it on manually. Swagger gives you the ability as the API developer to add self-documenting helper pages and test harnesses to your API. Recently John and I took some time away to discuss how to use Swagger to document a Web API written in ASP.NET Core using Swashbuckle and Visual Studio for the Mac Here is the result of that conversation. Check out the Play by Play on Pluralsight Resources docs.microsoft.com : ASP.NET Web API Help Pages using Swagger Swashbuckle GitHub repository Visual Studio for the Mac...


Exploring the new dotnet cli

Note: At the time of this post, the dotnet cli version being used 1.0.0-rc4-004771 available from GitHub dotnet/cli repo - https://github.com/dotnet/core/blob/master/release-notes/rc4-download.md I have been a long time fan of the yeoman generator for ASP.NET Core and still I would argue that it's still the most complete project creation utility for cross platform development. With that said, the dotnet cli has really raised the bar for command line parity development tooling when comparing similar capabilities from other languages or frameworks where CLI is the first tool. Historically, as you know, Visual Studio is the standard for "File->New Project" or anything to do with a .NET solution or...