原创 TagHelper 中使用 ViewBag 及其他

自定義一個 TagHelper       ViewContext 引用的空間 using Microsoft.AspNetCore.Mvc.Rendering; [HtmlTargetElement("card")] pu

原创 C#裏的重寫,淦!

先定義兩個類 public class A { protected void fun1() { fun2(); } protec

原创 netcore 中的url 重寫和動態添加重寫規則

URL 重寫可能會降低應用的性能。 如果可行,應限制規則的數量和複雜度。 何時使用 URL 重寫中間件 如果無法使用以下方法,請使用 URL 重寫中間件: 在 Windows Server 上使用帶 IIS 的 URL 重寫模塊 在

原创 docker 中:Cannot connect to the Docker daemon at tcp://localhost:2375. Is the docker daemon running

環境變量配置問題參考地址:https://github.com/docker/for-mac/issues/3039執行以下命令   unset DOCKER_HOST unset DOCKER_TLS_VERIFY unset DOCK

原创 Cannot connect to the Docker daemon at tcp://localhost:2375. Is the docker daemon running?

使用sudo + 命令 (每次多寫sudo,還要輸密碼,密碼錯了還要重來 :P ) sudo docker ps    (一次性的,不設置DOCKER_HOST)unset DOCKER_HOST unset DOCKER

原创 netcore項目中使用 SpringCloudConfig 和apollo做配置中心

版權所有,轉載請註明出處 https://www.cnblogs.com/netqq/p/14251403.html     一、使用apollo作爲配置中心   首先apollo 項目簡介和安裝請自行百度,本文只介紹如何使用      坑

原创 netcore 連接sql server 2014 ubuntu20.04踩坑-SSL_connect: error:1425F102 .. unsupported protocol

第一次往上 liunx上部署netcore  服務,數據庫採用了sql server 2014 在運行服務時候無法啓動遇到了錯誤 ERROR 2026 (HY000): SSL connection error: error:1425F1

原创 .netcore 自帶日誌組件的配置

日誌配置 "Logging": { "IncludeScopes": false, "Debug": { "LogLevel": { "Default": "Debug"

原创 IdEntityServier4 遇到的坑

響應頭: Bearer error="invalid_token", error_description="The issuer is invalid"  狀態碼:401 原因:token頒發的地址用的是localhost:8802    

原创 .netcore 雜項

https 跳轉到 http 時的 Referer 丟失   獲取服務自身監聽的地址: /var server = serviceProvider.GetRequiredService<IServer>(); var

原创 spring boot 初學筆記

springboot 配置文件中需要             在tomcat   server.xml中  配置   <Host name="localhost" appBase="webapps" unpackWARs="true"

原创 時間格式 和 時間戳

一、UTC時間   時間格式如下:2018-01-22T09:12:43.083Z  或  2013-11-17T11:59:22+08:00   (此處描述不準確:+08:00後結果是北京時間)   其中z 代表是世界協調時間,即:utc

原创 微服務

1、consul 2、Gateway->Ocelot 3、服務治理 Steeltoe.Discovery.ClientCore  4、緩存 CSRedisCore 5、服務調用 Feign.net 一套 6、日誌 NLog 7、接口文檔組件

原创 enum的應用及flags特性

 enum的作用不做描述,這是C#的基礎 設置enum 很簡單,本文不做討論。 但是enum設置值有種特殊方式,如 enum en { a=1, b=2, c=4,

原创 netcore 中的動態代理與RPC實現(微服務專題)

一、關於RPC的調用   1. 調用者(客戶端Client)以本地調用的方式發起調用;  2. Client stub(客戶端存根)收到調用後,負責將被調用的方法名、參數等打包編碼成特定格式的能進行網絡傳輸的消息體;  3. Client