原创 使用MediatR遇到的一個問題記錄
一直使用MediatR做進程內消息通信,到另一個項目後,也引入了MediatR。使用的時候發現一個問題,發送一次,消息會被訂閱兩次。 查看是否手動重複注入了,並沒有。 然後想到這個項目使用了AutoFac,猜測是被自動注入了。查看注入邏輯,
原创 容器cpu佔用高的問題排查
1、top命令查看佔用高的進程的pid 2、根據pid查看容器id docker ps -q | xargs docker inspect -f '{{.State.Pid}} {{.Config.Hostname}}' | grep 9
原创 net core 中使用skywalking及skywalking的docker部署
一、docker部署elasticsearch docker run -d -p 9200:9200 -p 9300:9300 --name es -e "discovery.type=single-node" -e ES_JAVA_OP
原创 通過Attribute和結果過濾器記錄用戶操作記錄
/// <summary> /// 用戶操作記錄 /// </summary> [AttributeUsage(AttributeTargets.Class | AttributeTargets.Metho
原创 實現微信掃碼後關注公衆號自動登錄
一、原理 1、獲取access_token https://developers.weixin.qq.com/doc/offiaccount/Basic_Information/Get_access_token.html 2、獲取帶參二維碼
原创 Visual Studio 2022 新增的開發隧道功能
用微信公衆平臺測試賬號做微信公衆號開發的時候,需要配置回調地址 由於項目在本地,沒有發佈。url裏需要一個公網可以訪問的域名,以前的解決辦法是使用內網穿透,本地vs啓動項目後,可以通過公網地址調本地的項目接口。 現在vs2022的最
原创 智能AI代碼工具Cursor的使用
// Import necessary namespaces using System.Net.Http; using System.Text; using System.Threading.Tasks; // Define
原创 本地調試代碼時報錯:The remote certificate is invalid because of errors in the certificate
執行以下命令即可 dotnet dev-certs https --clean dotnet dev-certs https --trust Enforce HTTPS in ASP.NET Core | Microsoft Lear
原创 assembly.GetManifestResourceStream嵌入資源
var assembly = Assembly.GetExecutingAssembly(); var stream = assembly.GetManifestResourceStream(path) 得到的stre
原创 windows下使用docker
之前一直在Linux上玩docker,這次嘗試下在windows上操作docker。做下總結: 首先啓動docker desktop。 1、VS中右鍵-發佈項目 2、在dockerfile所在目錄下執行 docker build -
原创 SwaggerIgnore
/// <summary> /// SwaggerIgnoreAttribute /// </summary> [AttributeUsage(AttributeTargets.Class | Attrib
原创 做滑動驗證碼遇到的坑總結
1、本地調試正常, 部署到Docker裏,會報錯: Unable to load shared library 'libSkiaSharp' or one of its dependencies. 解決辦法:把SkiaSharp包刪掉,引用
原创 git一個本地倉庫,配置兩個遠程倉庫
git一個本地倉庫,配置兩個遠程倉庫,git push的時候會推送到兩個遠程倉庫 方法: 找到並打開git的配置.git/config。 把url改爲如下
原创 RazorEngine實現代碼生成器
RazorEngine實現代碼生成器 TODO
原创 postman調試grpc接口
一直用postman調試http接口,很順手。 這次試了下調試grpc接口,方便 然後導入proto文件 選擇調用的grpc接口,調用