Diachok's IT blog
IT Sector Life
Thursday, November 19, 2020
Tuesday, September 22, 2020
How to integrate Angular 9 with an ASP.NET Core Project
The best article for updating angular to the latest version(yes it work and for Angular 10).
I had issue after update from Angular 8(from Microsoft template) to 9 and 10, by the way this issue with one string "ng serve --verbose"
Sometimes this brings more happiness: ' "start": "echo Starting... && ng serve" '
Saturday, September 19, 2020
Wednesday, September 16, 2020
Thursday, September 10, 2020
Steeltoe
I liked this project and the ideas it offers
Steeltoe makes programming .NET quicker, easier, and safer for everybody. Steeltoe’s focus on speed, simplicity, and productivity has made it one of the world's most popular .NET frameworks.
Steeltoe makes building web applications fast and hassle-free. By removing much of the boilerplate code and configuration associated with web development, you get a modern web programming model that streamlines the development of server-side HTML applications, REST APIs, and bidirectional, event-based systems.
Secrets of a .NET Professional
- The common language runtime conserves string storage by maintaining a table, called the intern pool, that contains a single reference to each unique literal string declared or created programmatically in your program.
- Reading more code makes us better developers.
- Nothing is free, and it always costs us something.
- Task.Awesome
- Learn LINQ
- Take It Easy On The Patterns
- One Project Is Fine*
- one good integration test is worth 1,000 unit tests
- Use Tools Other Than .NET
- A cohesive team with dated technology will outperform a dysfunctional team with the latest tech every time
Best way to create an empty collection (array and list) in C# (.NET)
For array will be the best - new TestArray[] { }
For list - new List
Wednesday, April 15, 2020
windows container in docker
Also, need to manage IIS.
I took part of the code here
The Dockerfile install aspnet windows container with 4.6.2 (because I using old code in my projects), enable in container IIS remote management and binding 443 port with SSL certificate
FROM mcr.microsoft.com/dotnet/framework/aspnet:4.6.2
ARG source
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
RUN Install-WindowsFeature -Name Web-Mgmt-Service
RUN New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\WebManagement\Server -Name EnableRemoteManagement -Value 1 -Force
#RUN New-NetFirewallRule -Action Allow -Direction Inbound -DisplayName IISManagement -Service WMSVC
RUN set-service -Name WMSVC -StartupType Automatic
RUN Get-Service -Name WMSVC | Start-Service
RUN net user admin 6H%*!k0*/I /ADD
RUN net localgroup administrators admin /add
#RUN New-WebBinding -Name 'Default Web Site' -IP '*' -Port 443 -Protocol https
RUN $newCert=New-SelfSignedCertificate -DnsName 'localhost' -CertStoreLocation cert:\LocalMachine\My; \
New-WebBinding -Name 'Default Web Site' -Protocol 'https'; \
$binding=Get-WebBinding -Name 'Default Web Site' -Protocol 'https'; \
$binding.AddSslCertificate($newCert.GetCertHashString(),'my')
EXPOSE 80 443
WORKDIR /inetpub/wwwroot
COPY ${source:-obj/Docker/publish} .
Wednesday, March 11, 2020
Powershell customization
Thursday, February 20, 2020
GitInfo. How using versioning from Git Tag and C# projects (frameworks and core)
A huge plus of GitInfo project is that besides the library itself you don’t need anything else
For dotnet core projects, I enable support Git and make the first commit and after I add Git Tag "0.1.0".
Then I add NuGet package "GitInfo"
Next step you need to add AssemblyInfo.cs, better to Properties folder
using System.Reflection;
[assembly: AssemblyVersion (ThisAssembly.Git.BaseVersion.Major + "." + ThisAssembly.Git.BaseVersion.Minor + "." + ThisAssembly.Git.BaseVersion.Patch)]
[assembly: AssemblyFileVersion (ThisAssembly.Git.SemVer.Major + "." + ThisAssembly.Git.SemVer.Minor + "." + ThisAssembly.Git.SemVer.Patch)]
[assembly: AssemblyInformationalVersion (
ThisAssembly.Git.SemVer.Major + "." +
ThisAssembly.Git.SemVer.Minor + "." +
ThisAssembly.Git.Commits + "-" +
ThisAssembly.Git.Branch + "+" +
ThisAssembly.Git.Commit)]
And last step change csproj, you need add 3 rows
<PropertyGroup> <GenerateAssemblyInfo>false</GenerateAssemblyInfo> </PropertyGroup>
After that, you can use GitInfo and versioning anywhere
Good luck!!!
Saturday, May 4, 2019
Thursday, February 14, 2019
Angular and url params
https://tutorialedge.net/typescript/angular/angular-query-params-tutorial/