<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Tricks on Hermit Blog</title><link>https://hermit.no/tricks/</link><description>Recent content in Tricks on Hermit Blog</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Wed, 06 Nov 2019 00:00:00 +0000</lastBuildDate><atom:link href="https://hermit.no/tricks/index.xml" rel="self" type="application/rss+xml"/><item><title/><link>https://hermit.no/tricks/netendoflife/</link><pubDate>Wed, 06 Nov 2019 00:00:00 +0000</pubDate><guid>https://hermit.no/tricks/netendoflife/</guid><description>&lt;h1 id="beware-of-the-end-of-life-for-net-framework-and-net-core-versions"&gt;Beware of the end-of-life for .Net Framework and .Net Core versions&lt;/h1&gt;&#10;&lt;p&gt;There are multiple versions of .Net Framework, and also of .Net Core. Many of the versions have now reached their end of life point. That means the versions are no longer supported, not with bug fixes and not with security fixes either.&lt;/p&gt;&#10;&lt;p&gt;Some version are in the LTS (Long Term Support) mode. This means they will receive critical fixes, and compatible fixes for a period of 3 years. Microsoft also states that every second release will be set up for LTS.&lt;/p&gt;</description></item><item><title>NUnit testing using the new project format</title><link>https://hermit.no/tricks/nunit-testing-using-the-new-project-format/</link><pubDate>Sun, 10 Jun 2018 16:38:00 +0100</pubDate><guid>https://hermit.no/tricks/nunit-testing-using-the-new-project-format/</guid><description>&lt;h1 id="nunit-testing-using-the-sdk-project-format"&gt;NUnit testing using the SDK project format&lt;/h1&gt;&#10;&lt;p&gt;This is a short recipe for how to set up your project for NUnit testing usign the SDK project format&lt;/p&gt;&#10;&lt;p&gt;Microsoft Visual Studio supports two project formats. The new format uses package references and are much simpler than the old one. It will also pick up any C# file in your folder, so you don&amp;rsquo;t need to add them explicitly.&lt;/p&gt;&#10;&lt;p&gt;All you need to do to use NUnit with the new format is as shown in the example csproj below. The target framework can be any of the .net framework ones. For information on using .net core, see &lt;a href="http://hermit.no/net-core-setup/"&gt;a short recipe for that&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Python numpy</title><link>https://hermit.no/tricks/python-numpy/</link><pubDate>Sun, 18 Feb 2018 19:08:23 +0100</pubDate><guid>https://hermit.no/tricks/python-numpy/</guid><description>&lt;h4 id="check-what-is-installed"&gt;Check what is installed&lt;/h4&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cmd" data-lang="cmd"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pip list&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id="downloading-and-installing-numpy"&gt;Downloading and installing numpy:&lt;/h4&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cmd" data-lang="cmd"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pip install numpy&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id="downloading-and-installing-matplotlib"&gt;Downloading and installing matplotlib&lt;/h4&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cmd" data-lang="cmd"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pip install matplotlib&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id="initializing-numpy-arrays-for-vectors"&gt;Initializing numpy arrays for vectors&lt;/h4&gt;&#10;&lt;p&gt;Array of 2D vectors, of length &amp;rsquo;n'&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-csharp" data-lang="csharp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;vectorArray&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;zeros&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Array of 3D vectors, of length &amp;rsquo;n'&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-csharp" data-lang="csharp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;vectorArray&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;zeros&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;3&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>How to add a terminal to Visual Studio 2017</title><link>https://hermit.no/tricks/add-terminal-visual-studio-2017-how-to-add-a-terminal-to-visual-studio-2017/</link><pubDate>Sun, 03 Dec 2017 11:27:00 +0100</pubDate><guid>https://hermit.no/tricks/add-terminal-visual-studio-2017-how-to-add-a-terminal-to-visual-studio-2017/</guid><description>&lt;p&gt;Visual Studio 2017 lack a proper internal terminal.  The Command Line extension has been a good substitute, but it opens up in a separate window.  If you work with multiple Visual Studio at the same time, you loose track of which command window belongs to which Visual Studio.&lt;/p&gt;&#10;&lt;p&gt;Visual Studio Code has it&amp;rsquo;s own Terminal window built-in, so why not Visual Studio itself?  Well, now it is there, a pre-pre tool called Whack Whack (because of how you open it).&lt;/p&gt;</description></item><item><title>Fixing missing project.json error in old csproj format</title><link>https://hermit.no/tricks/trick-fixing-strange-missing-project-json-error-old-csproj-format/</link><pubDate>Sat, 25 Nov 2017 15:55:15 +0100</pubDate><guid>https://hermit.no/tricks/trick-fixing-strange-missing-project-json-error-old-csproj-format/</guid><description>&lt;p&gt;When moving between old and new csproj formats, and back again when it doesn&amp;rsquo;t work, I have several times ended with a project.json error looking like this:&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="../images/2017/11/pjson.png"&gt;&lt;img src="../images/2017/11/pjson.png" alt="project json error message"&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;The cause comes from left over files in your obj catalogues.  The file in question seems to named project.assets.json.&lt;/p&gt;&#10;&lt;p&gt;Deleting these in all subfolders seems to do the trick.&lt;/p&gt;&#10;&lt;p&gt;Run, from the root of your repo:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-csharp" data-lang="csharp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;del&lt;/span&gt; &lt;span class="n"&gt;project&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;assets&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;json&lt;/span&gt; &lt;span class="p"&gt;/&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="p"&gt;/&lt;/span&gt;&lt;span class="n"&gt;q&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;[The below didn&amp;rsquo;t always work]&lt;/p&gt;</description></item><item><title>MSB4011</title><link>https://hermit.no/tricks/msb4011/</link><pubDate>Thu, 19 Oct 2017 10:17:06 +0100</pubDate><guid>https://hermit.no/tricks/msb4011/</guid><description>&lt;h1 id="issue-with-msb4011-warnings"&gt;Issue with MSB4011 warnings&lt;/h1&gt;&#10;&lt;p&gt;If MSB4011 warnings appears on every project you have, and you get &amp;ldquo;tons&amp;rdquo; of them, then you have this issue. In order to get rid of these annoying warnings you must fix up your installation as described below..&lt;/p&gt;&#10;&lt;h2 id="how-the-error-appears"&gt;How the error appears&lt;/h2&gt;&#10;&lt;p&gt;First of all, you see warnings like shown below in the Output window for build:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cmd" data-lang="cmd"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; C:\Program Files (x86)\MSBuild\15.0\Microsoft.Common.targets\ImportAfter\Microsoft.NuGet.ImportAfter.targets(16,3): warning MSB4011: &lt;span class="s2"&gt;&amp;#34;D:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\NuGet\15.0\Microsoft.NuGet.targets&amp;#34;&lt;/span&gt; cannot be imported again. It was already imported at &lt;span class="s2"&gt;&amp;#34;D:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Microsoft.Common.targets\ImportAfter\Microsoft.NuGet.ImportAfter.targets (16,3)&amp;#34;&lt;/span&gt;. This is most likely a build authoring error. This subsequent import will be ignored. [C:\Users\Terje\Source\Repos\ABC\Engine.csproj]&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; C:\Program Files (x86)\MSBuild\15.0\Imports\Microsoft.Common.props\ImportBefore\Microsoft.NuGet.ImportBefore.props(16,3): warning MSB4011: &lt;span class="s2"&gt;&amp;#34;D:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\NuGet\15.0\Microsoft.NuGet.props&amp;#34;&lt;/span&gt; cannot be imported again. It was already imported at &lt;span class="s2"&gt;&amp;#34;D:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Imports\Microsoft.Common.props\ImportBefore\Microsoft.NuGet.ImportBefore.props (16,3)&amp;#34;&lt;/span&gt;. This is most likely a build authoring error. This subsequent import will be ignored. [C:\Users\Terje\Source\Repos\ABC\Tool.csproj]&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Further, you see multiple of the same warnings in the Visual Studio Error window:&lt;/p&gt;</description></item><item><title>How to find/clear your Nuget caches</title><link>https://hermit.no/tricks/findclear-nuget-caches/</link><pubDate>Thu, 12 Oct 2017 19:25:20 +0100</pubDate><guid>https://hermit.no/tricks/findclear-nuget-caches/</guid><description>&lt;p&gt;Nuget maintains a set of caches on your local machine, or your build server.&lt;/p&gt;&#10;&lt;p&gt;Sometimes you need to find and clear a particular package, or simple clear the caches.&lt;/p&gt;&#10;&lt;p&gt;The most used locations can be found at:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cmd" data-lang="cmd"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;%LocalAppData%&lt;/span&gt;\NuGet\Cache&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;%UserProfile%&lt;/span&gt;\.nuget\packages&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The easiest way to find all of them however is to use nuget itself:&lt;/p&gt;&#10;&lt;p&gt;The following command lists all the cache locations:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cmd" data-lang="cmd"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;nuget locals all -list&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You will see four different cache locations.&lt;/p&gt;</description></item><item><title/><link>https://hermit.no/tricks/install-azure-cli-for-bash-on-windows/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://hermit.no/tricks/install-azure-cli-for-bash-on-windows/</guid><description>&lt;h1 id="installing-azure-cli-for-bash-on-windows"&gt;Installing Azure CLI for bash on Windows&lt;/h1&gt;&#10;&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;&#10;&lt;p&gt;This short guide explains how you get the Azure CLI to show up properly with the Bash shell in Windows.&lt;/p&gt;&#10;&lt;h2 id="checking-if-you-have-azure-cli-installed"&gt;Checking if you have Azure CLI installed&lt;/h2&gt;&#10;&lt;p&gt;You might have the Azure CLI installed even if it doesn&amp;rsquo;t show up in your bash shell. Check first using either Cmd or Powershell, by running e.g.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-csharp" data-lang="csharp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;az&lt;/span&gt; &lt;span class="p"&gt;--&lt;/span&gt;&lt;span class="n"&gt;version&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can run this from the bash shell, but using the full name of the cmd file:&lt;/p&gt;</description></item></channel></rss>