<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by latenightninjacoder on Medium]]></title>
        <description><![CDATA[Stories by latenightninjacoder on Medium]]></description>
        <link>https://medium.com/@latenightninja?source=rss-9268e8bdfae7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*4NB5sdWkfQ2SEiiEwizBnQ.jpeg</url>
            <title>Stories by latenightninjacoder on Medium</title>
            <link>https://medium.com/@latenightninja?source=rss-9268e8bdfae7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 17:07:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@latenightninja/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Building my DotNetCore 2.1 and Angular CLI 6.1 application]]></title>
            <link>https://medium.com/@latenightninja/building-my-dotnetcore-2-1-and-angular-cli-6-1-application-479feb7dc4e?source=rss-9268e8bdfae7------2</link>
            <guid isPermaLink="false">https://medium.com/p/479feb7dc4e</guid>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[angular-cli]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[dotnet-core]]></category>
            <dc:creator><![CDATA[latenightninjacoder]]></dc:creator>
            <pubDate>Thu, 26 Jul 2018 16:54:05 GMT</pubDate>
            <atom:updated>2018-07-26T17:07:59.935Z</atom:updated>
            <content:encoded><![CDATA[<p>So I have this ticket at work for a new web application that I am going to build using .NET Core 2.1 and using Angular CLI 6.1. For starters, I want to make sure that I have the latest nodejs and dotnetcore installed on my machine.</p><pre>PS C:\SandBox&gt; node --version<br>v10.6.0<br>PS C:\SandBox&gt; dotnet --version<br>2.1.302<br>PS C:\SandBox&gt;</pre><p>My dotnetcore package seems to be alright. My nodejs is still okay but it is nice to have the latest version available. Let’s go download and install the latest version from <a href="https://nodejs.org/en/">Node.js </a>website which is 10.7.0 as of this writing.</p><p>I also need the latest Angular CLI package installed. I usually install Angular CLI globally.</p><pre>npm install -g @angular/cli (or npm install -g @angular/cli@latest)</pre><p>I also need the ASP.NET core Angular template which can be installed via:</p><pre>dotnet new --install Microsoft.DotNet.Web.Spa.ProjectTemplates</pre><p>Now I have my dotnet project templates installed.</p><pre>Installing Microsoft.DotNet.Web.Spa.ProjectTemplates 2.0.0.</pre><p>Let’s create a new Angular project.</p><pre>dotnet new angular -o YetAnotherAngularProject</pre><p>Something is wrong. It didn’t generated an Angular project. Let’s try it again with some parameters.</p><pre>PS C:\SandBox&gt; dotnet new angular -o YetAnotherAngularProject -f netcoreapp2.1 --exclude-launch-settings false<br>The template &quot;ASP.NET Core with Angular&quot; was created successfully.</pre><p>*short clap*</p><p>It generated my these files.</p><pre>PS C:\SandBox&gt; cd .\YetAnotherAngularProject\<br>PS C:\SandBox\YetAnotherAngularProject&gt; ls</pre><pre>Directory: C:\SandBox\YetAnotherAngularProject</pre><pre>Mode                LastWriteTime         Length Name<br>----                -------------         ------ ----<br>d-----        7/26/2018  11:51 PM                ClientApp<br>d-----        7/26/2018  11:51 PM                Controllers<br>d-----        7/26/2018  11:51 PM                obj<br>d-----        7/26/2018  11:51 PM                Pages<br>d-----        7/26/2018  11:51 PM                Properties<br>d-----        7/26/2018  11:51 PM                wwwroot<br>-a----        7/26/2018  11:51 PM           3800 .gitignore<br>-a----        7/26/2018  11:51 PM            146 appsettings.Development.json<br>-a----        7/26/2018  11:51 PM            105 appsettings.json<br>-a----        7/26/2018  11:51 PM            643 Program.cs<br>-a----        7/26/2018  11:51 PM           2293 Startup.cs<br>-a----        7/26/2018  11:51 PM           2754 YetAnotherAngularProject.csproj</pre><p>Now I am not going to talk about project structure here and all that jazz. Let’s open this project from Visual Studio 2017 and build it.</p><pre>1&gt;------ Build started: Project: YetAnotherAngularProject, Configuration: Debug Any CPU ------</pre><pre>1&gt;YetAnotherAngularProject -&gt; C:\SandBox\YetAnotherAngularProject\bin\Debug\netcoreapp2.1\YetAnotherAngularProject.dll</pre><pre>1&gt;YetAnotherAngularProject -&gt; C:\SandBox\YetAnotherAngularProject\bin\Debug\netcoreapp2.1\YetAnotherAngularProject.Views.dll</pre><pre>1&gt;v10.7.0</pre><pre>1&gt;Restoring dependencies using &#39;npm&#39;. This may take several minutes...</pre><pre>1&gt;</pre><pre>1&gt;&gt; uws@9.14.0 install C:\SandBox\YetAnotherAngularProject\ClientApp\node_modules\uws</pre><pre>1&gt;&gt; node-gyp rebuild &gt; build_log.txt 2&gt;&amp;1 || exit 0</pre><pre>1&gt;</pre><pre>1&gt;</pre><pre>1&gt;&gt; node-sass@4.9.0 install C:\SandBox\YetAnotherAngularProject\ClientApp\node_modules\node-sass</pre><pre>1&gt;&gt; node scripts/install.js</pre><pre>1&gt;</pre><pre>1&gt;Downloading binary from https://github.com/sass/node-sass/releases/download/v4.9.0/win32-x64-64_binding.node</pre><pre>1&gt;Download complete</pre><pre>1&gt;Binary saved to C:\SandBox\YetAnotherAngularProject\ClientApp\node_modules\node-sass\vendor\win32-x64-64\binding.node</pre><pre>1&gt;Caching binary to C:\Users\iamweasel\AppData\Roaming\npm-cache\node-sass\4.9.0\win32-x64-64_binding.node</pre><pre>1&gt;</pre><pre>1&gt;&gt; uglifyjs-webpack-plugin@0.4.6 postinstall C:\SandBox\YetAnotherAngularProject\ClientApp\node_modules\webpack\node_modules\uglifyjs-webpack-plugin</pre><pre>1&gt;&gt; node lib/post_install.js</pre><pre>1&gt;</pre><pre>1&gt;</pre><pre>1&gt;&gt; node-sass@4.9.0 postinstall C:\SandBox\YetAnotherAngularProject\ClientApp\node_modules\node-sass</pre><pre>1&gt;&gt; node scripts/build.js</pre><pre>1&gt;</pre><pre>1&gt;Binary found at C:\SandBox\YetAnotherAngularProject\ClientApp\node_modules\node-sass\vendor\win32-x64-64\binding.node</pre><pre>1&gt;Testing binary</pre><pre>1&gt;Binary is fine</pre><pre>1&gt;npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.3 (node_modules\fsevents):</pre><pre>1&gt;npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.3: wanted {&quot;os&quot;:&quot;darwin&quot;,&quot;arch&quot;:&quot;any&quot;} (current: {&quot;os&quot;:&quot;win32&quot;,&quot;arch&quot;:&quot;x64&quot;})</pre><pre>1&gt;</pre><pre>1&gt;added 1260 packages from 1244 contributors and audited 7698 packages in 54.99s</pre><pre>1&gt;found 47 vulnerabilities (4 low, 32 moderate, 11 high)</pre><pre>1&gt;  run `npm audit fix` to fix them, or `npm audit` for details</pre><pre>========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========</pre><p>Looks fine so far but what are those npm audit fix messages ??!!?? Let’s put a pin on that later. Let’s just go ahead and execute the npm audit fix.</p><pre>PS C:\SandBox\YetAnotherAngularProject&gt; cd ClientApp<br>PS C:\SandBox\YetAnotherAngularProject\ClientApp&gt; ls</pre><pre>Directory: C:\SandBox\YetAnotherAngularProject\ClientApp</pre><pre>Mode                LastWriteTime         Length Name<br>----                -------------         ------ ----<br>d-----        7/26/2018  11:51 PM                e2e<br>d-----        7/26/2018  11:58 PM                node_modules<br>d-----        7/26/2018  11:51 PM                src<br>-a----        7/26/2018  11:51 PM           1408 .angular-cli.json<br>-a----        7/26/2018  11:51 PM            258 .editorconfig<br>-a----        7/26/2018  11:51 PM            572 .gitignore<br>-a----        7/26/2018  11:51 PM            956 karma.conf.js<br>-a----        7/26/2018  11:58 PM         418105 package-lock.json<br>-a----        7/26/2018  11:51 PM           1686 package.json<br>-a----        7/26/2018  11:51 PM            750 protractor.conf.js<br>-a----        7/26/2018  11:51 PM           1053 README.md<br>-a----        7/26/2018  11:51 PM            382 tsconfig.json<br>-a----        7/26/2018  11:51 PM           3155 tslint.json</pre><pre>PS C:\SandBox\YetAnotherAngularProject\ClientApp&gt; npm audit fix</pre><p>What do you do if build is successful? Click on the Run button and see if it works, right? So let’s do that! Click.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hVE1l6FVObclI_LOxZ3cyQ.jpeg" /></figure><p>Voila! Success!</p><p>But wait a minute. Why is my Angular CLI json configuration still named <em>.angular-cli.json </em>? The latest version of Angular CLI should be <em>angular.json</em>.</p><p>Seems like DotNetCore Project template is still using an older Angular CLI version. Let’s look at the package.json file.</p><pre>{<br>  &quot;name&quot;: &quot;YetAnotherAngularProject&quot;,<br>  &quot;version&quot;: &quot;0.0.0&quot;,<br>  &quot;license&quot;: &quot;MIT&quot;,<br>  &quot;scripts&quot;: {<br>    &quot;ng&quot;: &quot;ng&quot;,<br>    &quot;start&quot;: &quot;ng serve --extract-css&quot;,<br>    &quot;build&quot;: &quot;ng build --extract-css&quot;,<br>    &quot;build:ssr&quot;: &quot;npm run build -- --app=ssr --output-hashing=media&quot;,<br>    &quot;test&quot;: &quot;ng test&quot;,<br>    &quot;lint&quot;: &quot;ng lint&quot;,<br>    &quot;e2e&quot;: &quot;ng e2e&quot;<br>  },<br>  &quot;private&quot;: true,<br>  &quot;dependencies&quot;: {<br>    &quot;<a href="http://twitter.com/angular/animations">@angular/animations</a>&quot;: &quot;^5.2.0&quot;,<br>    &quot;<a href="http://twitter.com/angular/common">@angular/common</a>&quot;: &quot;^5.2.0&quot;,<br>    &quot;<a href="http://twitter.com/angular/compiler">@angular/compiler</a>&quot;: &quot;^5.2.0&quot;,<br>    &quot;<a href="http://twitter.com/angular/core">@angular/core</a>&quot;: &quot;^5.2.0&quot;,<br>    &quot;<a href="http://twitter.com/angular/forms">@angular/forms</a>&quot;: &quot;^5.2.0&quot;,<br>    &quot;<a href="http://twitter.com/angular/http">@angular/http</a>&quot;: &quot;^5.2.0&quot;,<br>    &quot;<a href="http://twitter.com/angular/platform-browser">@angular/platform-browser</a>&quot;: &quot;^5.2.0&quot;,<br>    &quot;<a href="http://twitter.com/angular/platform-browser-dynamic">@angular/platform-browser-dynamic</a>&quot;: &quot;^5.2.0&quot;,<br>    &quot;<a href="http://twitter.com/angular/platform-server">@angular/platform-server</a>&quot;: &quot;^5.2.0&quot;,<br>    &quot;<a href="http://twitter.com/angular/router">@angular/router</a>&quot;: &quot;^5.2.0&quot;,<br>    &quot;<a href="http://twitter.com/nguniversal/module-map-ngfactory-load">@nguniversal/module-map-ngfactory-load</a>er&quot;: &quot;^5.0.0-beta.5&quot;,<br>    &quot;aspnet-prerendering&quot;: &quot;^3.0.1&quot;,<br>    &quot;bootstrap&quot;: &quot;^3.3.7&quot;,<br>    &quot;core-js&quot;: &quot;^2.4.1&quot;,<br>    &quot;rxjs&quot;: &quot;^5.5.6&quot;,<br>    &quot;zone.js&quot;: &quot;^0.8.19&quot;<br>  },<br>  &quot;devDependencies&quot;: {<br>    &quot;<a href="http://twitter.com/angular/cli">@angular/cli</a>&quot;: &quot;~1.7.0&quot;,<br>    &quot;<a href="http://twitter.com/angular/compiler-cli">@angular/compiler-cli</a>&quot;: &quot;^5.2.0&quot;,<br>    &quot;<a href="http://twitter.com/angular/language-service">@angular/language-service</a>&quot;: &quot;^5.2.0&quot;,<br>    &quot;<a href="http://twitter.com/types/jasmine">@types/jasmine</a>&quot;: &quot;~2.8.3&quot;,<br>    &quot;<a href="http://twitter.com/types/jasminewd2">@types/jasminewd2</a>&quot;: &quot;~2.0.2&quot;,<br>    &quot;<a href="http://twitter.com/types/node">@types/node</a>&quot;: &quot;~6.0.60&quot;,<br>    &quot;codelyzer&quot;: &quot;^4.0.1&quot;,<br>    &quot;jasmine-core&quot;: &quot;~2.8.0&quot;,<br>    &quot;jasmine-spec-reporter&quot;: &quot;~4.2.1&quot;,<br>    &quot;karma&quot;: &quot;^2.0.5&quot;,<br>    &quot;karma-chrome-launcher&quot;: &quot;~2.2.0&quot;,<br>    &quot;karma-coverage-istanbul-reporter&quot;: &quot;^1.2.1&quot;,<br>    &quot;karma-jasmine&quot;: &quot;~1.1.0&quot;,<br>    &quot;karma-jasmine-html-reporter&quot;: &quot;^0.2.2&quot;,<br>    &quot;protractor&quot;: &quot;^5.4.0&quot;,<br>    &quot;ts-node&quot;: &quot;~4.1.0&quot;,<br>    &quot;tslint&quot;: &quot;~5.9.1&quot;,<br>    &quot;typescript&quot;: &quot;~2.5.3&quot;<br>  },<br>  &quot;optionalDependencies&quot;: {<br>    &quot;node-sass&quot;: &quot;^4.9.0&quot;<br>  }<br>}</pre><p>I need the latest version of Angular!</p><p>Let’s upgrade everything!</p><p>I am inside the ClientApp folder and I am going to upgrade my local Angular CLI.</p><pre>PS C:\SandBox\YetAnotherAngularProject\ClientApp&gt; npm install <a href="http://twitter.com/angular/cli">@angular/cli</a>@latest<br>npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.3 (node_modules\fsevents):<br>npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.3: wanted {&quot;os&quot;:&quot;darwin&quot;,&quot;arch&quot;:&quot;any&quot;} (current: {&quot;os&quot;:&quot;win32&quot;,&quot;arch&quot;:&quot;x64&quot;})</pre><pre>+ <a href="http://twitter.com/angular/cli">@angular/cli</a>@6.1.0<br>added 26 packages from 37 contributors, removed 415 packages, updated 9 packages, moved 28 packages and audited 12740 packages in 24.874s<br>found 41 vulnerabilities (2 low, 33 moderate, 6 high)<br>  run `npm audit fix` to fix them, or `npm audit` for details<br>PS C:\SandBox\YetAnotherAngularProject\ClientApp&gt;</pre><p>There’s that freaking npm audit fix again. Let’s execute that for now.</p><p>I got my latest Angular CLI but it seems like my json configuration file is still the old one. Let’s update all those Angular CLI files via the <em>ng update @angular/cli </em>command</p><pre>PS C:\SandBox\YetAnotherAngularProject\ClientApp&gt; ng update <a href="http://twitter.com/angular/cli">@angular/cli</a><br>            Updating karma configuration<br>            Updating configuration<br>            Removing old config file (.angular-cli.json)<br>            Writing config file (angular.json)<br>            Some configuration options have been changed, please make sure to update any npm scripts which you may have modified.<br>DELETE .angular-cli.json<br>CREATE angular.json (3809 bytes)<br>UPDATE karma.conf.js (993 bytes)<br>UPDATE src/tsconfig.spec.json (322 bytes)<br>UPDATE package.json (1733 bytes)<br>UPDATE tsconfig.json (407 bytes)<br>UPDATE tslint.json (3140 bytes)</pre><p>Let’s execute this nifty <em>ng update </em>command to know what other packages do we need to update.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5zAVA-tfV805wTw_M14ILw.jpeg" /></figure><p>Neat! Let’s update those packages by executing the suggested commands.</p><p>Seems like i have a problem when executing <em>ng update @nguniversal/aspnetcore-enging </em>it says package is not installed…..</p><p>Let’s move on. We can dig more on it later (or never).</p><p>So i got all those packages updated. Let’s open the project from Visual Studio 2017 again and build it.</p><p>Build was successful. Hooray!</p><p>Now hit F5 and run this sucker.</p><p>WHAT!?!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YtKnReTEsR4Num0lMJvV_A.jpeg" /></figure><p>Hhhmm… seems like this extract-css parameter is an unknown option.</p><p>Open your package.json file and remove this unknown option.</p><pre>&quot;start&quot;: &quot;ng serve --extract-css&quot;,<br>&quot;build&quot;: &quot;ng build --extract-css&quot;,</pre><p>It should now look like this (of course.. duh!)</p><pre>&quot;start&quot;: &quot;ng serve&quot;,<br>&quot;build&quot;: &quot;ng build&quot;,</pre><p>What’s the effect for removing that? I don’t know yet. I’ll have to figure it out.</p><p>But first let’s hit F5 again on Visual Studio.</p><p>Success! Time for a coffee break!</p><p>There you have it folks!</p><p>Code on <a href="https://github.com/latenightninjacoder/YetAnotherAngularProject">Github</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=479feb7dc4e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Best practices for using Strings in .NET]]></title>
            <link>https://medium.com/@latenightninja/best-practices-for-using-strings-in-net-17035d0b8015?source=rss-9268e8bdfae7------2</link>
            <guid isPermaLink="false">https://medium.com/p/17035d0b8015</guid>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[latenightninjacoder]]></dc:creator>
            <pubDate>Mon, 08 Jan 2018 04:53:26 GMT</pubDate>
            <atom:updated>2018-01-08T04:53:26.536Z</atom:updated>
            <content:encoded><![CDATA[<p>I always forget about Ordinal’s, Invariant’s and all those string comparison usages and best practices. So here’s a link from Microsoft that I can use as a quick reference or a brain refresher.</p><p><a href="https://docs.microsoft.com/en-us/dotnet/standard/base-types/best-practices-strings">Best Practices for Comparing Strings in .NET</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=17035d0b8015" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A quick start on setting up a Typescript app on Visual Code]]></title>
            <link>https://medium.com/@latenightninja/a-quickstart-on-setting-up-a-typescript-app-on-visual-code-b725c60c7307?source=rss-9268e8bdfae7------2</link>
            <guid isPermaLink="false">https://medium.com/p/b725c60c7307</guid>
            <category><![CDATA[code-newbie]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[latenightninjacoder]]></dc:creator>
            <pubDate>Mon, 08 Jan 2018 04:12:27 GMT</pubDate>
            <atom:updated>2018-01-08T04:12:56.206Z</atom:updated>
            <content:encoded><![CDATA[<ol><li>Create the appropriate folder and then launch Visual Code</li><li>Launch Terminal from Visual Code</li><li>Install Typescript. I usually do “npm install typescript — save-dev”</li><li>Execute tsc — init to create the tsconfig.json file</li><li>Create a helloword.ts file and copy/paste the following code:</li></ol><pre>class Startup {<br>    public static main(): number {<br>        console.log(&#39;Hello World&#39;);<br>        return 0;<br>    }<br>}</pre><pre>Startup.main();</pre><p>6. From Visual Code, Tasks -&gt; Run Build Task…</p><p>7. Select ‘tsc:build — tsconfig.json’ (<em>what’s the command line for this?</em>)</p><p>8. From terminal, execute by ‘node helloworld.js’</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b725c60c7307" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>