Subscribe: Rick Strahl's Web Log
Added By: Feedage Forager Feedage Grade A rated
Language: English
browser  code  content  control  core  creating  files  gist  gists  iis  markdown  net core  net  web browser  web  windows 
Rate this Feed
Rate this feedRate this feedRate this feedRate this feedRate this feed
Rate this feed 1 starRate this feed 2 starRate this feed 3 starRate this feed 4 starRate this feed 5 star

Comments (0)

Feed Details and Statistics Feed Statistics
Preview: Rick Strahl's Web Log

Rick Strahl's Web Log

Life, Surf, Code and everything in between


Using Gists for General Purpose Web Pages with Markdown

Mon, 20 Nov 2017 17:59:22 GMT

Many of you probably know that Github has a GitHub Gist Site that can be used to post and share snippets of code easily. Gists are great for sharing longer code snippets on social media sites like Twitter, where you can link to a Gist for discussion. You can even associate multiple files to a single Gist so if you need to show client and server code, or want to show an implementation and example, or a whole slew of related configuration files. Each of the files can be 'associated' with a different syntax for each file which is nice: Gists are like a single file Git Repository - Gists can be cloned and forked. There's also support for comments that allows for discussion of the code/text using the same comment system you use in Github issues. One missing feature is support for Pull Requests - which would be a really nice addition for interactively updating content. Gists support Markdown Gist as code snippets is pretty cool and powerful all by itself, but what's actually even more exciting is that Gists support Markdown. Yeah you probably knew that, but are you using this functionality as much as you should? More Detailed Code Discussions If you're creating Gists for discussion purposes - especially when sharing the discussion on Twitter - I'd argue that creating a Markdown file is almost always better than creating one or more source files individually, because you can actually say something useful about the code you are sharing and frame the code in the context of the discussion (or vice versa). The comment support allows you to continue the discussion past the pointer when the Twitter conversation has scrolled off the feed. I also like Markdown because trying to cram a description into a text box usually sucks, especially if you have multiple bits of code. With Markdown's capability of embedding code snippets with syntax highlighting, I think it's an an infinitely more approachable way for sharing code along with explanation. For example here's a bug I ran into and shared on Twitter via a Gist link while back: Notice there are multiple snippets (which can all be using different syntax). As I went through this, I updated the text and eventually ended up with a mini-blog like entry. The thought process is there as well as the solution. Because it's Markdown I can now also pick up the Markdown - as is - and stick it into my Markdown editor for a future blog post which saves some additional time. Gist as Mini Blogs Because Gists support Markdown that is turned into HTML, you can use it to create one off HTML pages that you can easily share. If you don't have a blog and you want to write up something you found during development this is a great way to put out something public. Even if you have a blog you might have content that's too small or not a good fit for a blog and you can write it as a Gist instead. Sort of a blog away from your blog 😄 There's a difference from GitHub Issues though - you can't embed images into the document by pasting them in and having GitHub store them which is a bummer. All images you use have to be externally stored somewhere else. Gists to share 'Secret' Text Gists can also be 'secret' which merely means the Gist isn't linked anywhere or shown in your profile. Anybody can access the Gist if the URL is known, but the URL isn't shared unless you explicitly give it out to somebody. I've found this useful in many situations where I needed to share some short lived information that wouldn't transfer over email (like emails with links to download files that are blocked for example) and Gists work just fine for that. Gists for Configuration Settings I also use Gists for storing non-sensitive configuration settings. Machine configuration scripts short registry scripts, I have them shuttled away as private gists that I reuse when paving a machine. There are also a number of tools that store their configuration settings as Gists. There's a VS Code syncing utility that creates a shared backup configuration as Gist. Tools like BoxStarter store Chocolatey scripts to run as Gists. Gists have a relative[...]

Dev Intersection 2017 Session Slides and Samples Posted

Thu, 09 Nov 2017 07:31:20 GMT

I've posted my Session Slides and code samples from last week's DevIntersection conference. It's been a while since I've been at a .NET Conference and as always after all the toil and tension getting ready for sessions, it all ends up being a blast as was catching up with friends after hours. Thanks for those of you that attended my sessions and filled out the sessions rooms so nicely 😃. There were also a lot of good questions and discussions after all sessions which is always great. I was especially happy to see so many turn out to the Localization talk - which is a tough sell in the best of circumstances, and especially tough as the last session on the last day. Here are the three sessions (or two if I count the Angular/ASP.NET one as a single long session). Using Angular with ASP.NET Core Part 1: Getting started Part2: Putting it all together Part 1 of this session was basically an all code demo for creating a first Angular app and then hooking it up to an ASP.NET Core backend API. Part 2 then looked at a more realistic albeit small application and dives into the details about how to integrate Angular and ASP.NET and manage many common aspects like error handling, user authentication, deployment and hosting and more. The slides for these sessions are combined into a single large deck that are much more numerous than what I used during the session, filling in the details that were either covered by code samples or handled in the live coding bits. Samples and Slides: Localization in ASP.NET Core This session introduced localization in .NET in general and then jumped into the specifics of how to use the new dependency injection based localization features in ASP.NET Core. Several sample pages that are provided in the Github link below. The session also covered how to use Westwind.Globalization as a database driven resource localizer, along with a discussion on how to implement a custom Localizer implementation in .NET Core. Samples and Slides: Hope some of you find these materials useful. Enjoy. this post created and published with Markdown Monster © Rick Strahl, West Wind Technologies, 2005-2017Posted in ASP.NET Core   Angular   Localization   [...]

.NET Core 2.0 and ASP.NET Core 2.0 are Here

Mon, 23 Oct 2017 06:19:51 GMT

After a long wait .NET Core and ASP.NET Core 2.0 are finally here. This release is a major update from Version 1.0 that brings back a ton of functionality that was originally missing in .NET Core 1.x. With closer compatibility to full framework .NET it's much easier to port existing code to .NET Core, as having a much larger API surface to use in your applications. There are many usability improvements that make it easier to get started using considerable less fanfare. In this post I describe some of what's new and what's great and also a few things that are not so great.(image)

Opening a Web Browser with an HTTP Url from Visual Studio Code

Fri, 13 Oct 2017 21:28:20 GMT

Here's a quick tip on how you can create a project specific Visual Studio Task that can launch a Web Browser to a specific page quickly and easily.(image)

A few notes on creating Class Libraries for ASP.NET Core

Tue, 26 Sep 2017 16:09:13 GMT

I recently started to collect some of my ASP.NET Core utilities into a helper support library as I tend to do. In the process I ran into a few snags and I realized I was making a few non-obvious mistakes right from the start. In this post I discuss a few of the issues with dependencies and how to deal with them.(image)

WPF Slow Window Loading due to Invalid SpellChecking Dictionaries

Mon, 25 Sep 2017 17:54:30 GMT

I ran into a nasty problem with spell checking on WPF, which caused any form that uses spell checking to load extremely slow. It turns out the problem was caused by errant entries in the global Windows dictionary key in the registry. This post describes the problem and how to find and fix your global Windows dictionary settings.(image)

Conditional TargetFrameworks for Multi-Targeted .NET SDK Projects on Cross-Platform Builds

Mon, 18 Sep 2017 18:07:57 GMT

If you build multi-targeted .NET SDK projects on multiple platforms you're going to find out that certain targets can't be build on certain platforms. If you target NetStandard and Net45 on a Mac, Net45 is going to fail. In order to get around this you need to conditionally build per platform. Here's how.(image)

Accepting Raw Request Body Content in ASP.NET Core API Controllers

Thu, 14 Sep 2017 18:39:53 GMT

When posting raw body content to ASP.NET Core the process is not very self-explanatory. There's no easy way to simply retrieve raw data to a parameter in an API method, so a few extra steps are provided using either manual handling of the raw request stream, or by creating custom formatter that can handle common 'raw' content types in your APIs via standard Controller method parameters. In this post I look at various permutations and how you can access the raw data in your code.(image)

A Literal Markdown Control for ASP.NET WebForms

Wed, 13 Sep 2017 17:00:50 GMT

Spent some time last night creating a small ASP.NET Server control that can render literal Markdown text inside of ASPX pages and turn the literal text into Markdown. It's a very simple control, but it makes it lot easier to edit documents that contain simple formatted text content without having to deal with angle brackets for lengthier text.(image)

Configuring LetsEncrypt for ASP.NET Core and IIS

Sat, 09 Sep 2017 17:12:01 GMT

LetsEncrypt makes it easy to create SSL certificates for your applications for free and lets you automate the process. When using LetsEncrypt with IIS and ASP.NET Core however a few extra steps are required to make an ASP.NET Core site work with LetsEncrypt. I show you how in this post.(image)

Handling HTML5 Client Route Fallbacks in ASP.NET Core

Mon, 07 Aug 2017 17:40:07 GMT

HTML5 client routes work great on the client, but when deep linking into a site or pressing refresh in the browser, HTML5 client side routes have a nasty habit of turning into server HTTP requests. Requests to routes that the server is likely not configured for. In this post I look at why HTML5 client routes require server cooperation to handle and how to set them up on IIS and/or ASP.NET Core.(image)

Updating Windows Applications and Installers for non-Admin Installation

Tue, 18 Jul 2017 06:54:04 GMT

I recently updated Markdown Monster to run as a non-admin installation even when running the full installer. There have been many requests for this functionality and in this post I describe several of the updates required in order to make this work.(image)

JavaScript Debugging in a Web Browser Control with Visual Studio

Fri, 07 Jul 2017 02:24:15 GMT

Debugging a Web Browser Control embedded in a Windows application can be a bear because there's no obvious way to debug the the JavaScript code or HTML DOM/CSS inside of the application. Although the Web Browser uses the Internet Explorer Engine for HTML rendering and JavaScript execution and provides most of the engine features, the Debugger and F12 are not part of that. As it turns out you can use Visual Studio to hook up a script debugger and provide a rich debugging experience with the full IE debugger, Console and even a DOM/CSS Explorer. In this post I show how.(image)

Debouncing and Throttling Dispatcher Events

Mon, 03 Jul 2017 05:32:49 GMT

In UI applications it's not uncommon for a number of UI events to fire more events than your application can handle. In order to limit the number of events it's often a good idea to throttle or 'debounce' events so that only a single event is fire for a given period. In this post I describe a Dispatcher based implementation for debouncing and throttling UI events in WPF applications.(image)

Multi-Targeting and Porting a .NET Library to .NET Core 2.0

Thu, 22 Jun 2017 16:46:07 GMT

I've been holding off porting any of my full frameworks to .NET Core. With the latest .NET Core 2.0 and .NET Standard 2.0 releases and their vastly larger footprints that match more closely with what we expect of the .NET Framework feature set, migrating looks a lot more appealing. In this post I describe the process of porting one of my general purpose full framework libraries to .NET Standard 2.0 and in the process also creating a multi-targeted project that compiles .NET 4.5, 4.0 and .NET Standard projects.(image)

Bypassing IIS Error Messages in ASP.NET

Thu, 01 Jun 2017 22:30:42 GMT

IIS Error handling is the source of lots of confusion. I've been using IIS for nearly 20 years now, and figuring out the right combination of error configuration settings and code to properly serve custom error pages or error responses in API still makes fumble a few times before I get it just right. This post provides a few hints and some background on how to deal with error handling.(image)

Automating IIS Feature Installation with Powershell

Thu, 25 May 2017 19:30:28 GMT

IIS often gets a bad wrap for being diffcult to install and configure. However, using some of the built-in tooling for administration using PowerShell it's actually quite easy to configure IIS and even set up a new site and application pool with a few short scripts that are much quicker, and more repeatable than using the various Windows UI features. Here's how.(image)

Upgrading to .NET Core 2.0 Preview

Tue, 16 May 2017 04:42:00 GMT

With the release of the first preview of .NET Core 2 and ASP.NET Core 2.0 I decided to upgrade my AlbumViewer sample application to the latest bits and preview tools. Overall the experience was pretty smooth, but I ran into a couple of breaking changes and a few tooling snags that I'll describe in this post.(image)

IIS and ASP.NET Core Rewrite Rules for Static Files and Html 5 Routing

Fri, 28 Apr 2017 02:26:44 GMT

If you're running ASP.NET Core under Windows with IIS, you'll want to take advantage of letting IIS serve up your static content and handle your HTML 5 Client and home routes. IIS is very efficient at handling static content and content re-routing and in this post I describe how you can properly configure ASP.NET Core applications using the AspNetCoreModule and IIS Rewrite Rules(image)

Creating a Markdown Monster Addin: Save Images to Azure Blob Storage

Mon, 17 Apr 2017 16:30:29 GMT

The Markdown Monster Markdown Editor and Weblog Publishing tool has a .NET based addin model that makes it relatively easy to extend its core feature set with custom functionality. In this post I show how you can quickly create an addin of your own, and then show a practical example that demonstrates how add Image uploading to Azure Blob storage as an interactive addin.(image)

Running .NET Core Apps under Windows Subsystem for Linux (Bash for Windows)

Thu, 13 Apr 2017 19:53:07 GMT

The Windows Shell for Linux (WSL or Bash on Ubuntu on Windows) provides a nice way for Windows and Linux to interact without the overhead of dealing with a separate VM. Using the WSL you can now also run your .NET Core applications directly under Linux without requiring a VM or Docker. In this post I demonstrate how the shell works and how you can run your .NET and ASP.NET Core applications to test operation under Linux.(image)

Virus Scanning Madness for Software Distribution

Sun, 02 Apr 2017 19:22:35 GMT

I've been having having lots of problems recently with VirusTotal, which is used by Chocolatey to scan for malware in Chocolatey distribution packages. VirusTotal is a Web based service that aggregates around 60 virus scanners against an installation binary. The problems is that I frequently see random malware hits by various obscure scanners. In this post I describe the problem and the farce that this has become as some of the malware hits are obviously false positives that actually reverse in a rescan.(image)

Updating my AlbumViewer Sample to ASP.NET Core 1.1 and Angular 4

Fri, 31 Mar 2017 08:05:54 GMT

I updated my AlbumViewer sample application recently to the latest versions of ASP.NET Core (1.1) and the new .csproj project as well Angular 4(image)

More on ASP.NET Core Running under IIS

Fri, 17 Mar 2017 05:40:45 GMT

Since my last post about hosting ASP.NET Core on IIS I've gotten quite a few questions and comments in regards to working with this mixed IIS/Kestrel hosting environment. There are quite a few not so obvious arrangement in this set up and some surprising discoveries in terms of performance and segragation of feature usage between IIS and Kestrel.(image)

Dragging and Dropping Images and Files into the Web Browser Control

Fri, 10 Mar 2017 09:23:34 GMT

Dragging content into the Web Browser control and capturing the content dropped can be tricky. The Web Browser Control is based on Internet Explorer and is actually an ActiveX control hosted inside of a container and because of that is difficult to deal with. In this post I describe how you can get around this issue and still capture images and files dropped on the control and handle the drop operations.(image)