General

Welcome to 2018

This isn’t the post I had planned for this week, but thanks to a failed automatic upgrade of one of the WordPress plugins this site uses I had to restore a back up of the site which destroyed a lot of the post meant for this week. Thankfully NodeHost does automatic backups every day and the restore process is super simple.

On the positive, it gives me a chance to try out something new. I am going to list the books that I read last year. For the ones that are available on Amazon, I am using affiliate links just to see what happens. A lot of these books come from John Sonmez’s book reviews playlist. Without further adieu here is the list broken out by rough category.

Biographical/Entertaining

Elon Musk: Tesla, SpaceX, and the Quest for a Fantastic Future
Living with a Seal (I laughed a lot on this one)

Business

EntreLeadership (Free gift from CodeStock 2 years ago)
The Phoenix Project

Health

The Obesity Code (Very informational if you struggle with weight read this one)

Parenting

The Kazdin Method for Parenting the Defiant Child

Personal Development

Think and Grow Rich
Boundaries
Triggers: Creating Behavior That Lasts
Never Split the Difference: Negotiating As If Your Life Depended On It
Banish Your Inner Critic
The Energy Bus
Eat That Frog!
The 10X Rule
Peak Secrets from the new Science of Expertise
Moonwalking with Einstein
Deep Work

Software/Career

SOLID Principles Succinctly
.NET Core Succinctly
Little ASP.NET Core Book
The Imposter’s Handbook
The Complete Software Developer’s Career Guide

Top Picks

The Phoenix Project is at the very top of my list from 2017 it uses a story to teach lean concepts from an IT perspective. I which I could get everyone in my company to read this book.

The Energy Bus helped me adjust my perspective and have a more positive outlook on life. If you have any issues with negativity check it out.

The 10X Rule is pretty high on my list as well. This book will get you taking action toward your goals if you follow its advice.

If you have any recommendations leave a comment as I am always looking to add new books to my backlog.

Welcome to 2018 Read More »

Hitting a wall

I have had a very frustrating week. I got sick, failure on two different blog posts, basically no progress on any project. I hit walls on everything I attempted.

Everyone has bad weeks and if you look back I am sure you will find I have made a couple of posts along these same lines. I don’t post this type stuff to complain, but instead to be clear that this isn’t easy and at times is a struggle. I share this so that it can be an encouragement when you hit your own walls. Everyone faces struggles. Pick your hero and I can promise that they struggle.

We tend to see only the positives from the lives of other people which makes what we are going through feel worse and unfair. Comparing the full depth of yourself to the public face of others is an easy way to head down a very negative path. A path I have struggled with at times.

If you struggle with some of the same things I recommend that you check out the content of John Sonmez and Gary Vaynerchuk. Both of them have helped me push through some of the walls I have hit. The Energy Bus by Jon Gordon has also been helpful for staying positive.

Whatever wall you are hitting keep working and push through. You can do this.

Hitting a wall Read More »

NDepend Spotlight

Today I am going to be doing a tool spotlight on NDepend. NDepend has a ton of features to help you keep a handle on your applications including the following plus much more.

  • Code Rules
    • 200 default rules with ability to add custom rules using LINQ
  • Quality Gates
  • Visual Studio Integration
  • Build Process Integration
  • Dependency Graph
  • Dependency Matrix
  • Technical Debit Estimation

For full disclosure, NDepend reached out to me to give their tool a try. I am writing based on my experiences with their tool and will be including both the positive and negative aspects of my experience. None of the links in this post are referrals that would in any way provide me any sort of payment.

Installation

The download is a zip file that you then have to find out what you want to do with. This was the first negative I hit with the product. While it isn’t hard to figure out it would be much nicer if this were an installer where I could select what I wanted to install instead of having to look at the getting started docs right away. For non-build usage, the options to run the tool is either via a Visual Studio extension (NDepend.VisualStudioExtension.Installer) or as a stand alone application (VisualNDepend.exe).

I chose to go explore with the Visual Studio extension. As a hint that I didn’t notice until later, VisualNDepend provides an option to install the Visual Studio extension in addition to providing all the functionality of the Visual Studio extension.

Visual Studio Extention

After installing the NDepend extension there will be a new top level NDepend menu in Visual Studio.

With the solution you want to analyze already open select the NDepend > Attach New NDepend Project to Current VS Solution.

This will launch a dialog that allows you to select which assemblies you would like to analyze preloaded with the assemblies for the current application.

As you can see from the dialog there are a lot of options. If your project has other assemblies or solutions that you would like to be included as part of the analyses they are easy to add. When finished adding items to analyze click the Analyze button at the bottom. I am using a small project for this entry and the process took less than 10 seconds. I also tried it on a large project (500k+ lines of code) and it took less than 30 seconds.

After the analyses are complete the extension shows a dialog asking what to do next as well as launching a web page with the results of the analyses if you kept the Build Report check box checked. Following are the options in the dialog.

From here I chose to View NDepend Dashboard, but also make sure and check out the report that the analyses generated as it provides a great summary at the end of all the issues found. The following is a part of the dashboard.

There is a ton of data provided. If you notice at the top there is a Choose Baseline option which would allow comparisons of solutions over time. I can see this view of a project over time is very helpful, but not a feature I will get to explore here.

Exploration

Exploration of the data NDepend provides is something I could spend hours looking at even on a small project. For example, the following is an output to HTML (their output is much prettier than the version that is shown here) of the issues that make up the critical group in the Rules box in the dashboard above.

4 rules Issues Debt Annual Interest Breaking Point Category Full Name
Avoid methods with too many parameters 1 issue 1h 9min 5min 4 522d Project Rules \ Code Smells Rule
Avoid non-readonly static fields 12 issues 32min 4h 0min 48d Project Rules \ Immutability Rule
Avoid namespaces mutually dependent 2 issues 30min 1h 1min 179d Project Rules \ Architecture Rule
Avoid having different types with same name 3 issues 30min 1h 0min 182d Project Rules \ Naming Conventions Rule
Sum: 18 2h 41min 6h 6min 4 933d
Average: 4.5 40min 1h 31min 1 233d
Minimum: 1 30min 5min 48d
Maximum: 12 1h 9min 4h 0min 4 522d
Standard deviation: 4.39 16min 1h 28min 1 899d
Variance: 19.25 34d 979d overflow

Here is the same view inside the Queries and Rules Edit window.

Double click any line will take you to a detail view showing a listing of the rule broken down by project, namespace, and class.

The same window also shows the query that was used to find the rule violations. For example, the above is powered by the following query.

warnif count > 0
from f in Application.Fields
where f.IsStatic && 
     !f.IsEnumValue && 
     !f.IsGeneratedByCompiler &&
     !f.IsLiteral &&
     !f.IsInitOnly

let methodAssigningField = f.MethodsAssigningMe

select new { 
   f, 
   methodAssigningField,
   Debt = (2+8*methodAssigningField.Count()).ToMinutes().ToDebt(),
   Severity = Severity.High
}

The above is CQLinq or Code Query LINQ which is used to query the code model that the NDepend analysis creates. The detail of CQLinq are outside the scope of this post, but based on the above you can see how powerfully this could be.

Other considerations

Based on my usage to get the best value from NDepend your whole team would need to be licensed and making sure new code satisfies with all the rules your team wishes to follow. NDepend has a component that can be used as part of server based build processes which is needed, but I would want to use that component as a fail safe, not as a way to avoid buying licenses. If you use multiple computers it seems that you will need multiple licenses which will cause issues for some users.

Wrapping up

After trying NDepend out for awhile I am still amazed at the amount of data it provides. Not to mention the ability to add new queries and rules of your own. One blog post is never going to be enough to cover even a fraction of what this tool does. It feels like Resharper in it does so much that it takes a lot of time to learn and take advantage of the full set of features it provides.

NDepend Spotlight Read More »

First talk retrospective

I made it through my first lightning talk at the May meeting of the Nashville .NET user group. If you want some background you can check out this post on my preparation for the talk.

This post is going to be mostly for me to look back on in the future in case I decided to attempt another talk, but I am sure if someone is a new speaking it could be a useful as well.

Retro

Overall the talk went OK. There was no huge epic failure, but it far from a good talk. I was extremely nervous which lead to me be locked to the podium and flying through the talk way faster than I should have. I am pretty soft spoken and didn’t project as much as I really needed to. As a result of that is my points weren’t as clear as I would have liked.

David Neal was right that the audience does want you to succeed. There were a couple of questions at the end of my talk which made me feel that my point wasn’t totally lost. I got feedback for some of the audience members and other speakers which I included in the previous paragraph. All the feedback was presented to me in a kind manner which I greatly appreciated.

The future

In the future, if I try speaking again I have a lot of things I can improve on. I know that sounds negative, but I am looking at it as an opportunity to grow. I now know that I will need more time during the prepping stage to practice out loud and in front of people.

I love technology and sharing what I learn with others. That is one of the reasons I write this blog every week. Speaking may or may not be part of the future way I get to share with other, but I am happy to now know it is something I can do. It would require a ton of work, but it is no longer something I can’t ever see myself doing.

First talk retrospective Read More »

Visual Studio 2017 Error: The project doesn’t know how to run the profile IIS Express

I have a couple of computers I work between for the samples I use on this blog and when switching to between of them I got the following error last week.

The project doesn’t know how to run the profile IIS Express.

I verified the project would still run on the other computer with no issues. I also verified that on the computer with the issues the project would still work using dotnet run from the command line still worked.

Next, I went to verify the project properties. Here I noticed a strange thing on the computer with the error the Debug tab of the project properties was missing a lot of setting. The following is a screen shot of the computer with the issues.

And here is the same tab on the same project, but from a different computer.

The cause

After more time that I would like to admit I was able to track down the issue. On the computer with the issue, I often work on projects that are very large which tend to slow down Visual Studio pretty bad. In an effort to speed things up a bit I when through and disabled all the extensions that I could including the Microsoft Azure App Service Tools. Turns out that disabling the previous extension caused the Microsft ASP.NET and Web Tools extension to be disabled as well (with no warning).

The solution

The only way I was able to get the project to work properly was to enable both the Microsft ASP.NET and Web Tools extension AND the Microsoft Azure App Service Tools extension. I am not sure why the Microsft ASP.NET and Web Tools extension need the Microsoft Azure App Service Tools extension but based on my experience they are related in some way.

Visual Studio 2017 Error: The project doesn’t know how to run the profile IIS Express Read More »

Setting Up Visual Studio Code for Debugging ASP.NET Core

Visual Studio Code is a cross-platform source code editor from Microsoft. Out of the box, Code’s language support includes JavaScript, TypeScript, and Node. Using Codes extension system support is available for almost any language you want to use including C#, F#, Elixir, SQL, Swift, and Java. As of this writing, there are 734 language extensions available.

I have been using VS Code since it was first released after Build in 2015, but I have only been using it as an editor never taking advantage of the Debugging capabilities it has available. In this post, I am going to walk through everything that is needed to get a new ASP.NET Core with an Angular front end to run via VS Code’s debugger.

Test application

The first thing I did was to create a new application using JavaScriptServices specifically for this post. For instructions on how to use JavaScriptServices to generate an application check out this post.

On Windows, after the application has been generated and you are in the application directory you can use the following command to open the directory in VS Code.

code .

I am sure there is something similar on Linux and Mac, but I don’t have the environments to try on.

VS Code Overview

When VS Code opens you will see a view close to the following.

The icons down the left side of the screen are for Explorer (shows currently open directory and files), Seach, Source Control (git support is built in), Debug, and Extensions.

Debug

The Debug tab will be our focus so click on it which will take you to the following view.

Using the gear with red circle select .NET Core as the environment for the project.

If you don’t see .NET Core listed click More… and click install for the C# option.

After selecting an environment VS Code will add a launch.json file to the project. This file defines what happens when the start button is clicked in the debugger. At this point clicking the start button to run the application using the debugger will result in an error that Could not find the preLaunchTask ‘build’.

Next, click the Configure Task Runner option and select .NET Core.

This will add a task.json file with a build command that the launch.json is looking for. At this point, I had to restart VS Code to get it to properly pick up the new files. This seems to be an issue that will be fixed with the next release of VS Code and can be tracked using this issue.

After restart and trying to run the debugger again I ran into the error Run ‘Debug: Download .NET Core Debugger’ in the Command Palette or open a .NET project directory to download the .NET Core Debugger.

I ended up having to uninstall and reinstall the C# extension and then opening a C# file to get the debugger to download. If you are having this problem make sure and open a C# file before going as far as reinstalling the C# extension.

Hitting run in the debugger now give the error launch: launch.json must be configured. Change ‘program’ to the path to the executable file that you would like to debug.

To fix this issue click Open launch.json and you will find two places with the following.

"program": "${workspaceRoot}/bin/Debug/<target-framework>/<project-name.dll>"

Change both places to point to the dll your application builds. In the case of my project named DebugTest the final version ended up being the following.

"program": "${workspaceRoot}/bin/Debug/netcoreapp1.1/DebugTest.dll"

Wrapping up

Debugging now works! Based on this post it would seem like debugging in VS Code is a big pain, but really after you get it set up once it just works. For new projects, you just have to let it add the

For new projects, you just have to let it add the launch.json and tasks.json and then set the path to your project’s assembly in launch.json. After that, you are ready to go.

I wait too long to figure this process out. I hope this helps you get started with debugging in VS Code.

Setting Up Visual Studio Code for Debugging ASP.NET Core Read More »

Preparing for my first talk

I will be doing an intro lightning talk on JavaScriptServices at the May meeting of the Nashville .NET user group. The meeting will be over by the time this post comes out, but I wanted to share my outlook on it before hand.

Background

This will be the first time I have done any sort of talk since the required speeches I did in grammar and high school. In college, all the required speaking was attached to some sort of group work in which I was happy to do some extra legwork if another group member was willing to do the presentation.

Based on what I have written so far I am sure you have picked up on the fact that speaking is terrifying to me. Although I have forced myself into more social situations in the last few years it has done nothing to alleviate my fear of speaking to a group of people.

Motivation

Trying speaking is something that has been in the back of my mind for a few years. Speaking is an area I have always shied away from, but over the last few years listening to people like Scott Hanselman, Cory House, Jeremy Clark and David Neal among others and their take on speaking/giving back to the community planted a seed that speaking is something I need to try at least once.

David Neal’s talk on Public Speaking without Barfing on Your Shoes was especially encouraging to me. Here is a recording of the talk from the last Nodevember.

Preparation

I decided on JavaScriptServices because it has provided a great amount of value to personally and I want more people to be aware of it. With the topic in hand, I moved on to making an outline of what I want to cover. Since this talk should max out at 10 minutes my initial outline ended up needing to be scaled back.

The next thing I did was to create a checklist of all the thing I need to do before the talk. The following is an example of where it stands at the moment.

  • Flesh out the outline
  • Add important items for each point in the outline
  • Create and test demo
  • Test demo offline
  • Create a couple of slides
  • Practice out loud

Of the above having to practice out loud is the one I dread the most. I am not sure what it is about hearing one’s own voice, but it is always disconcerting.

 Wrapping up

I am still in the prepping stages and ever day that the talk gets closer the more nervous I get. There is also a level of excitement to see if this could be something I enjoy. It would be fun to have a new way to share my enjoyment and lessons learned outside of this blog.

I will post an update here or a full new post after the talk with how I felt it went. I will also hopefully have the feedback of a few others as well.

Preparing for my first talk Read More »

Communication Issues

My wife recently had an interesting experience with her cell phone company and this experience reiterated to me the importance of communication. This post is going to cover some high-level issues I encounter regularly.

For a bit of background here is a description of out experience with the cell phone company. First level support was awesome. They were responsive, kind, and mostly knew what they were talking about. Our case ended up getting passes to second level support and this is where things went bad.

Under communication

This company’s second level support was a perfect example of under communication. It was impossible for us to communicate with a second level support person we had to just sit around and wait for them to email us. In fact, even a first level support person could actually talk to a second level support.

The response took days of sitting around and hoping that our issues haven’t fallen through the cracks. The lack of communication ended with use changing cell providers based on the level of under communication. Had we been able to get a status or be told where the issue stood things would have turned out different.

It doesn’t matter if you are dealing with your family, customers or coworkers make sure to communicate what you are doing, what your expectations, what issues you are facing, etc. by providing this information everyone will be on the same page and have good expectations of each other.

Noisy communication

This issue comes up when you are communicating, but the idea being communicated is lost due to an unfocused message. Make sure that each of your points is concise and to the point.

To extend the cell phone example above a noisy version of describing the problem would be describing to the support person how angry the issues is making you, why the weather make you angry, the problem with the cell service, the cool new trick your dog did yesterday.

In the above, the really important bit is the problem with your cell service and the rest of it distracts and obscures what the actual point of the communication.

Dishonest communication

Intentionally providing wrong information for me is the worst communication offense. Missing leading someone either through omission of facts or a full blown lie is a sure way for any process to break down. I feel people try and make the best choices they can, but when making choices based on false or missing information the results aren’t good.

Another big issue with dishonest communication is when someone finds out that you have been dishonest with them if changes all future interactions in a very negative way.

Wrapping up

I have only listed three communication issues here that I seem to deal with for the most, but there are tons of more issues. Take time to evaluate your day to day communication and make sure your communication isn’t unclear for some reason. Don’t let some of this issues cost you customer, employees or friends.

Communication Issues Read More »

Visual Studio 2017 error encountered while cloning the remote Git repository

Going through the process of getting Visual Studio 2017 installed on all my machines has been pretty smooth. The new installer works great and makes it much clearer what needs to be installed.

The issue

The one issue I have had, which was only an issue on one install, is an error when trying to clone a repo from GitHub. I say GitHub but really it would be a problem with any Git repo. The following is the error I was getting.

Error encountered while cloning the remote repository: Git failed with a fatal error.
CloneCommand.ExecuteClone

The solution

After searching I found a lot of things to try. I uninstalled and reinstalled Git for Windows multiple times using both the Visual Studio Installer and the stand alone installer. I finally stumbled onto this forum thread which had a solution that worked for me. The following is a quote of the reason for the issue and a fix posted by J Wyman who is a software engineer for Microsoft’s Developer Division.

After intensive investigation we were able to determine that Git was accidentally loading an incorrect version of libeay32.dll and ssleay32.dll due to library loading search order and precedence rules. Multiple users have confirmed that copying the binaries from the “<VS_INSTALL>\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\mingw32\bin\” folder to the “<VS_INSTALL>\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\mingw32\libexec\git-core\” folder completely resolved the issue for him.

Any other users seeing similar problem should attempt the same solution.

I hope this gets other people up and running as it did me. My only worry about this fix is what happens with Git gets updated.

Visual Studio 2017 error encountered while cloning the remote Git repository Read More »

Two Years of Blogging

Wednesday will mark two years for this blog. This post is going to be a bit of a retrospective on my blogging journey so far.

Positives

A number of positive things have come out of maintaining this blog some of them I expected other were surprises.

  • Driver for learning new things
  • Opportunity to use new/different technology outside of my normal work
  • Helping people learn a new concept or get past a sticking point
  • New connections with people outside of my normal circles
  • Improvements to my written communication skills
  • Improvements in picking up new technology

Challenges

In addition to the above, the following is a list of things that challenged me. Some of them have helped me grow and others continue to give me problems.

  • Learning new things on a deadline
  • Self-applied pressure to meet my goal of a post a week
  • Not focusing on stats, shares, comment, etc.
  • Picking the right things to learn
  • Losing focus

Hosting challenges

I hit quite a few issues with my host this year. The biggest being multiple multi-day downtimes, high site load times, and difficult to implement SSL support.

In an attempt to address the second two problems I started using Cloudflare which worked well, but the lack of SSL support from my host cause some quirky issues.

All this led to me switching to NodeHost last month. That is a referral link that will give you a $5 credit when you sign up. NodeHost does all their hosting on SSDs and has built-in support for Let’s Encrypt which took care of my SSL problems. Getting a site setup initially was harder that on my old host, but it was totally worth the switch and ended up costing less.

Even with the hosting change I still recommend using Cloudflare. By using Cloudflare my host is having to handle around 50% few requests thanks to Cloudflare’s caching.

Top post of the year

It is interesting to look back and see which post have done the best over time. It is surprising to me that my first post is still in the top 5 post for the last year. One of my top posts was featured on ASP.NET community spotlight which always pushes way more traffic.

The next year

From where it stands now I see more than enough things in the ASP.NET Core/Aurelia/Angular areas to learn and they will continue to be my focus over the next year. I am especially excited that ASP.NET Core tooling to be complete and for Visual Studio 2017 to be released this year. I am also really looking forward to the .NET Standard 2 support to be released. With those two items taken care of, I will feel completely comfortable recommending ASP.NET Core it a much wider range of scenarios.

As always I am open to topic suggestions for topics and happy to answer questions. Thank you for the support of the last couple of years.

Two Years of Blogging Read More »