心雨纷扬的博客

一个简单的博客

Dive into the New Features of .NET 8

In today’s rapidly evolving technological landscape, the .NET framework is constantly evolving to adapt to new demands and challenges. As the latest iteration, .NET 8 brings numerous exciting new features and improvements, empowering developers to build applications more efficiently. Below, we delve into several key features of .NET 8.

First and foremost, let’s look at the performance enhancements. Performance has always been a key focus area for the .NET framework. In .NET 8, Microsoft introduces a new feature called “performance counters,” which helps developers gain insights into their application’s performance bottlenecks and take appropriate optimization measures. Additionally, .NET 8 includes optimizations to many existing components and libraries, aiming to enhance the overall performance of applications. This includes improvements to the asynchronous programming model and better support for cloud-native applications.

When it comes to the asynchronous programming model, .NET 8 introduces a new type of coroutine. Coroutines are lightweight threads that can handle asynchronous operations and long-running tasks more naturally. Compared to traditional threads, coroutines can execute multiple asynchronous operations on the same thread, eliminating the overhead of thread switching and context switching. This not only improves the efficiency of program execution but also makes code easier to write and understand.

For cloud-native applications, .NET 8 provides improved support. Cloud-native applications are designed according to a set of principles that enable them to better adapt to containerized and microservices architectures. .NET 8 makes it easier to deploy applications to platforms like Kubernetes, while supporting the use of containerization tools like Docker for packaging and distribution. These features make .NET 8 an ideal choice for building cloud-native applications.

In addition, .NET 8 introduces new development tools such as R#, Visual Studio Code, and Visual Studio IDE. These tools greatly enhance developer productivity, enabling them to write, debug, and test code more efficiently.

Cross-platform compatibility has always been an essential feature of the .NET framework. With .NET 8, this aspect is further enhanced, allowing developers to build cross-platform applications that can run on multiple platforms, including Windows, macOS, and Linux operating systems. This means developers can use .NET 8 to build applications that better cater to the needs of diverse user bases.

Artificial intelligence (AI) and machine learning are among the hottest technology trends today. .NET 8 ships with built-in support for AI and machine learning, making it easier for developers to incorporate these technologies into their applications. This provides developers with a significant advantage in应对 market challenges.

Lastly, security is a critical aspect of any software development project. In .NET 8, Microsoft makes further improvements to security. These include better code signing and encryption techniques, limitations on .NET reflection, and enhancements to code access controls. These improvements help developers build more secure applications that protect user data and privacy.

In conclusion, .NET 8 introduces numerous exciting new features and improvements that provide developers with more tools and options for building efficient, secure, cross-platform applications. Whether it’s performance, asynchronous programming models, cloud-native support, developer tools, cross-platform compatibility or security, .NET 8 showcases its capabilities and strength. If you’re a developer or looking for a robust development framework to build your applications with, .NET 8 is definitely worth considering.

概念

kubectl

Kubernetes 命令行工具 kubectl, 让你可以对 Kubernetes 集群运行命令。 你可以使用 kubectl 来部署应用、监测和管理集群资源以及查看日志。

安装

Windows 11 使用 winget:

Powershell
1
2
3
4
5
6
7
8
9
winget install -e --id Kubernetes.kubectl

kubectl version --output=yaml

cd ~

mkdir .kube
cd .kube
New-Item config -type file

验证 kubectl 配置

如果你想在自己的笔记本上(本地)运行 Kubernetes 集群,你需要先安装一个 Minikube 这样的工具

1
2
3
4
winget install minikube
minikube start

kubectl cluster-info

环境

参考文档: https://masastack.github.io/helm/

docker

安装 Docker Desktop,目前版本的 Docker Desktop 附带一个 kubernetes ,在设置里启用 kubernetes , 就可以跳过后续的 kuberneteskubectl 的安装.

docker

kubernetes

参考:https://kubernetes.io/zh-cn/docs/tasks/tools/

kubectl

参考:https://kubernetes.io/zh-cn/docs/tasks/tools/

阅读全文 »

MASA Framework
全新的.NET现代应用开发,提供分布式应用运行时–基于Dapr云原生最佳实践,能够快速实现分布式、微服务、DDD,SaaS等现代应用开发。官方文档参阅

先决条件

开发计算机上应安装以下工具:

一个集成开发环境 (比如: Visual Studio) 它需要支持 .NET 6.0 的开发.

环境配置

MacOS dotnet环境配置

1
2
3
4
5
6
7
8
# 下载对应脚本进行安装 https://dotnet.microsoft.com/zh-cn/download/dotnet/scripts 
./dotnet-install.sh --channel 6.0

echo 'export DOTNET_ROOT=$HOME/.dotnet' >> ~/.zshrc
echo 'export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools' >> ~/.zshrc

source ~/.zshrc

阅读全文 »

Abp vNext 学习第七弹 - 作者

参考上一篇 :Abp vNext 学习(6).

领域层

简介

在前面的章节中, 我们使用 ABP 框架轻松地构建了一些服务;

  • 使用 CrudAppService 基类, 而不是为标准的增删改查操作手工开发应用服务.
  • 使用 generic repositories 自动完成数据层功能.

对于 “作者” 部分;

  • 我们将要展示在需要的情况下, 如何 手工做一些事情.
  • 我们将要实现一些 领域驱动设计 (DDD) 最佳实践.

开发将会逐层完成, 一次聚焦一层. 在真实项目中, 你会逐个功能(垂直)开发, 如同前面的教程. 通过这种方式, 你可以体验这两种方式

阅读全文 »

Hexo Change Permanent Link Format

Recently I would like to simplify permanent link for each post. From:

/2020/09/12/deploy-docker-on-ubuntu18-04
/2022/12/15/abplearn/sixth
To:

/deploy-docker-on-ubuntu18-04
/abplearn/sixth

If you don’t care about the search engine drop right after directly changing the permalink, you can change the config in _config.yml ,change permalink from :year/:month/:day/:title/ to :title/ directly. otherwise, please read on.

阅读全文 »

Apply cert for domain

this article is apply cert for domain on ubuntu 22.04

Install nginx

1
sudo apt install nginx

Install snap

1
2
3
4
sudo snap install core
sudo snap refresh core
# Remove certbot-auto and any Certbot OS packages
sudo apt-get remove certbot

Install certbot

1
2
3
4
5
6
7
8
9
#Install Certbot
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
sudo snap set certbot trust-plugin-with-root=ok
#Install correct DNS plugin
sudo snap install certbot-dns-aliyun
sudo snap set certbot trust-plugin-with-root=ok
sudo snap connect certbot:plugin certbot-dns-aliyun
/snap/bin/certbot plugins

Set up DNS credentials of aliyun

Go to https://ram.console.aliyun.com Apply AliYun child account And Set AliyunDNSFullAccess permission。Then create AccessKey for child account。

create certbot-dns-aliyun config:

1
2
3
4
5
6
cat > /home/ubuntu/aliyun.ini <<EOF
dns_aliyun_access_key = 12345678
dns_aliyun_access_key_secret = 1234567890abcdef1234567890abcdef
EOF

chmod 600 /home/ubuntu/aliyun.ini

Apply cert for nginx

1
2
3
4
sudo certbot -i nginx -a dns-aliyun  
--certbot-dns-aliyun:dns-aliyun-credentials /home/ubuntu/aliyun.ini
-d xyfy.loan
-d "*.xyfy.loan"