• Home
  • About me

DotNetSwede

A blog about .NET, C#, JavaScript and technology in general.

Month: February 2016

Microsoft Acquires Xamarin – Cross-platform C# Development Is Here to Stay

24th February 2016 by Jonathan Lindkvist Leave a Comment

With today’s acquisition announcement we will be taking this work much further to make our world class developer tools and services even better with deeper integration and enable seamless mobile app dev experiences. The combination of Xamarin, Visual Studio, Visual Studio Team Services, and Azure delivers a complete mobile app dev solution that provides everything a developer needs to develop, test, deliver and instrument mobile apps for every device. We are really excited to see what you build with it.

We are looking forward to providing more information about our plans in the near future – starting at the Microsoft //Build conference coming up in a few weeks, followed by Xamarin Evolve in late April. Be sure to watch my Build keynote and get a front row seat at Evolve to learn more!

Wow! I suppose cross-platform app development using C# is definitely here to stay. I’ve been working on putting together a blog post about IoT development using C# and .NET, which got me thinking about C# on different platforms.

Solid cross-platform support is the key to the future success of C# and .NET, and I think that Microsoft’s acquisition of Xamarin proves that they’re genuinely dedicated to continuing on the path that they’ve started on with .NET and ASP.NET Core. It seems like Microsoft’s CEO agrees:

Any app, any OS, any dev, truly universal developer tools. Welcome @Xamarinhq to @Microsoft https://t.co/i5EGkENNTu

— Satya Nadella (@satyanadella) 24 februari 2016

So from now on C# will have Microsoft’s backing on:

  • ASP.NET Core — C# web development for Windows, Linux and Mac
  • Windows 10 IoT Core — C# Internet of Things development for Raspberry Pi, as well as other IoT devices
  • Xamarin — C# mobile phone application development for Windows Phone, Android and iOS
  • Azure — C# development of cloud-based applications and services

To some extend, it kind of feels like they’ve now gone “full circle” with this acquisition. Anyway, it’s an exiting time to be a C# developer. 🙂

 

You’ll find Scott Guthrie’s blog post that I cited at the beginning of this post here.

More information will be given on Microsoft’s Build conference (March 30 – April 1).

Posted in: .NET News Tagged: Cross-platform C#, Cross-platform mobile apps, Microsoft, Xamarin

Error Logging, Profiling and Analytics Tools for .NET Applications

21st February 2016 by Jonathan Lindkvist 1 Comment

Even though my own code is perfect — and certainly in no need of any “error logging tool” — I’ve still wondered if there’s any good tools out there worth considering for such things. At first I thought that there’d only be a like couple of decent alternatives out there for the .NET stack, but there seems to bee fair amount interesting solutions out there, so I’ll just summarize some of the more interesting ones briefly. I’m hoping that I’ll be able to delve more deeply into one of them in a future post once I’ve had the chance to see one, or a couple of them in action.

Some of the the tools below are more targeted at performance profiling, and others more for error logging and analytics — and some contain a mixture of all of those things.

Prefix.io

Prefix is a new free service created by Stackify that also offer a commercial solution for cloud-based error logging, as well as metrics for all kinds of applications. Anyway, Prefix is a free solution targeted at .NET applications. Prefix claims to offer features such as:

  • Real-time capture of ASP.NET requests
  • Tracking of SQL queries that are executed by your application
  • Tracking of usage and performance of both Microsoft and third party libraries, such as Redis, MongoDB, Memcached and so on

Check out the Prefix website, or the documentation for more information.

Glimpse

Glimpse is a free and open source diagnostics solution for ASP.NET web applications. Glimpse is probably the most capable open source solution out there, and it certainly seems like a wonderful project. Scott Hanselman even titled a blog post “if you’re not using Glimpse with ASP.NET for profiling and debugging, you’re missing out”. Some features of Glimpse:

  • Real-time diagnostics and insights
  • Free and open source
  • Inspects web requests as they happen
  • Intercept SQL queries
  • See how long it took to execute SQL queries

Glimpse website is here.

Here’s a Channel9 video labeled “A Peek at Glimpse with Anthony van der Hoorn” that might be a very good starting-point for looking into Glimpse.

dotTrace

This is a .NET “performance profiler” made by JetBrains, the creators of ReSharper and the new C# IDE “Project Rider” that I wrote about a while back.

  • dotTrace integrates with ReSharper
  • Profile to detect performance bottlenecks
  • It’s integrated with Visual Studio

The dotTrace website is here.

New Relic

I’ve encountered New Relic many times, and they definitely seem like a proven alternative. Some features of New Relic are:

  • Analyze application performance
  • Get alerts about exceptions and errors
  • Support for Azure, and its available on the Azure marketplace
  • Support for Umbraco

You’ll find more about New Relic’s .NET offering here.

ELMAH

ELMAH (Error Logging Modules and Handlers) is an application-wide error logging facility that is completely pluggable. It can be dynamically added to a running ASP.NET web application, or even all ASP.NET web applications on a machine, without any need for re-compilation or re-deployment.

ELMAH is essentially an open source project that gives you a centralized location to view your applications error logs. It has features such as:

  • “Logging of nearly all unhandled exceptions.”
  • Gives you a web page where you can view your (or your colleagues) exceptions

EMLAH is free, open source, and its installed locally so it seems like a very neat solution for error logging. It’s available here.

Visual Studio Application Insights

Application Insights is already tightly integrated with Visual Studio and Microsoft Azure, so if you’re already invested in that ecosystem then it might certainly be worth considering. Application Insights is an APM (Application Performance Monitoring) tool, which is what New Relic also labeled their solution. I found a brief introductory video here at Channel9. Some notable points about Application Insights are:

  • Telementary data from web and mobile applications (and so on)
  • Real-time monitoring of usage and performance
  • Provides the ability to perform tests running in Azure
  • Already tightly integrated with Visual Studio, Azure and .NET

And there’s obviously a lot more at the Application Insights website.

ASP.NET Core Logging

Microsoft’s new ASP.NET Core has built-in support for logging. Core is more customizable than previous versions, which also holds true for its logging functionality. If you’re interested in ASP.NET core logging, then consider some of the alternatives below:

  • The built-in logging functionality in ASP.NET Core (see the docs here)
  • elmah.io has a logging provider for Core
  • Loggr also has a logging provider for .NET Core, check it out at GitHub
  • NLog has a .NET Core logging provider for the NLog library
  • … and there’s also a provider for .NET logging library Serilog

 

That’s all for this post, but I’m sure I’ll get back to things related to these topics in future blog posts as well.

Posted in: Tools Tagged: .NET Core Logging, Analytics, Error Logging, Logging, Profiling

Installing Multiple Modules at the Same Time in DNN

16th February 2016 by Jonathan Lindkvist Leave a Comment

Installing multiple modules through the DNN user interface is very time-consuming, but luckily there’s an easier and faster way of installing modules in DNN. So in order to do a batch installation of multiple modules just follow the steps outlined below.

1. Add your zipped modules to the “/Install/Module/” folder

Build your modules in release mode and drop the zipped modules into:

YourDnnFolder/Install/Module/

2. Navigate to “/install/install.aspx?mode=installresources”

Open up a browser window and navigate to the URL:

http://YourDnnSite.url/install/install.aspx?mode=installresources

… and all of the modules that you dropped into the module folder earlier will now be installed for you.

Posted in: Content Management Systems (CMS) Tagged: DNN, DotNetNuke

Early Access to Project Rider – JetBrains new Cross-Platform C# IDE

12th February 2016 by Jonathan Lindkvist 1 Comment

JetBrains, the company behind ReSharper — are working on a new cross-platform C# IDE called “Project Rider”. They announced the project in a blog post back in January, and it’s basically a cross-platform C# IDE based on IntelliJ and ReSharper technology. While I do love Visual Studio, I’ve been longing for a capable alternative IDE, and JetBrains Project Rider might turn out to be just that. The IDE is still under development, but JetBrains just released another blog post in which they link to a page where you can subscribe to take part in the early access program for the Project Rider IDE. I’ve filled out the form myself, and I’m eager to see how this IDE eventually turn out. 🙂

Posted in: Tools Tagged: IDE, JetBrains, Project Rider, ReSharper

Convert JSON and XML to POCOs Automatically

11th February 2016 by Jonathan Lindkvist 1 Comment

If you’re working against an API then you’ll probably get your data in either JSON or XML format. In order to deserialize those JSON and XML objects into their C# equivalents you’ll need actual POCOs to serialize to. Luckily, Visual Studio has built in functionality for this already.

How to convert JSON and XML to POCOs in Visual Studio

Edit > Paste Special > Paste JSON As Classes/Paste XML As Classes

That’s it! If you don’t feel like opening up Visual Studio then you can also use the online tool json2csharp which does JSON to C# POCO conversion online.

 

This feature is one of many “hidden” gems in Visual Studio that I love. 🙂

Posted in: Visual Studio Tagged: Convert JSON to POCO, JSON, POCOs, Visual Studio, XML

How to Delete All Breakpoints in Visual Studio

8th February 2016 by Jonathan Lindkvist Leave a Comment

I usually end up having breakpoints all over my code which can get quite annoying, especially if it’s older breakpoints in parts of the application which I’m currently not working on. Luckily there’s a keyboard shortcut for removing all breakpoints in the solution:

Ctrl + Shift + F9

Source: This Stack Overflow thread

Posted in: Visual Studio Tagged: Keyboard shortcuts, Visual Studio

Selecting the First or Last Element using jQuery

6th February 2016 by Jonathan Lindkvist Leave a Comment

It’s very common that you might want to target the last and/or the first element matching a particular query selector (e.g. <li> elements). As you can see from the snippets below, jQuery makes such tasks quite easy.

A list of elements…

For the jQuery samples below, just assume we’re targeting an unordered list like the one below:

<ul>
  <li>First</li>
  <li>Second</li>
  <li>Third</li>
</ul>

Selecting the first list element using jQuery

var firstListItem = $('li').first();

Selecting the last list element using jQuery

var lastListItem = $('li').last();

Setting a different styling for the first element

If your intention is to change the styling for the first or last element, then all you have to do is to add another method (through a concept called method chaining) like this:

$('li').first().css('color', 'red');

 

For more information, make sure to check out the jQuery documentation for the first() and last() methods.

Posted in: jQuery Tagged: first(), jQuery, last(), Traversing

What Your App Really Looks Like

5th February 2016 by Jonathan Lindkvist Leave a Comment

what-your-app-looks-like

Cartoon from Eric Burke licensed under a Creative Commons license.

Posted in: Fun Tagged: Comic, Eric Burke

Using Commit Commands to Reference and/or Change the Status of Assembla Tickets

3rd February 2016 by Jonathan Lindkvist Leave a Comment

I use Assembla at work and it’s nice to have source code repositories, wikis, tickets and other useful things all in one place. In Assembla you work with tickets which are used for logging user stories, bugs, features as well as other things related to the software development process. I work with TortoiseSVN and VisualSVN (SVN integration for Visual Studio) in order to synchronize my code with the repository at Assembla. One nice feature of Assembla is the ability to use commit commands that enables you to reference and/or change the status of Assembla tickets directly from your commit messages. I’ve assembled some of the most useful ones below.

Referencing a ticket from a commit message

If you want to link your commit to a ticket you simply write “re #120” in order to link your commit to ticket number 120. A full example of this would be something like: “I’ve worked on improving the page load time (re #75)”.

Closing a ticket from a commit message

If you want to set the ticket status to closed, then you could use “Fixed #245” in order to set the status of ticket 245 to fixed. Another way of closing a ticket would be to mark it as invalid by writing “Invalid #223” which would close ticket 223 and mark it as invalid.

Setting ticket status as ‘Test’ from a commit message

A common task is to move a ticket from status programming to test which is easily done by writing “Test #190”.

As you can see, the commit commands simply follow the basic structure of “{Command} #{Ticket number}”, and they’re not case sensitive, so “test #120” would work just as well as “Test #120”.

 

Good luck!

Posted in: Tools Tagged: Assembla, Commit Commands, Subversion, SVN, TortoiseSVN, VisualSVN

Don’t Forget about Bobby

1st February 2016 by Jonathan Lindkvist Leave a Comment

exploits_of_a_mom

Classic comic from xkcd.

Posted in: Fun Tagged: Comic, Database, SQL Injection

Recent Posts

  • Listing the names of all SQL Server instances
  • Modular Monoliths
  • Clean Architecture
  • AngularJS to Angular Upgrade Paths
  • Web Scraping with C#

Recent Comments

  • Roy on Convert JSON and XML to POCOs Automatically
  • James David on A List of ASP.NET Based Content Management Systems
  • Dany Wehbe on Web Scraping with C#
  • rainadawan on Web Scraping with C#
  • Clean Architecture - How to Code .NET on Clean Architecture

Archives

  • April 2019
  • November 2018
  • January 2018
  • August 2017
  • July 2017
  • May 2017
  • April 2017
  • March 2017
  • February 2017
  • January 2017
  • December 2016
  • November 2016
  • October 2016
  • September 2016
  • August 2016
  • July 2016
  • June 2016
  • May 2016
  • April 2016
  • March 2016
  • February 2016
  • January 2016

Categories

  • .NET
  • .NET News
  • Architecture
  • ASP.NET
  • Content Management Systems (CMS)
  • Fun
  • JavaScript
  • jQuery
  • Learning
  • Tools
  • Visual Studio
  • Webdesign

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org

Copyright © 2019 DotNetSwede.

Omega WordPress Theme by ThemeHall.