随笔分类 - C#/NetCore
摘要:dotnet new wasiconsoledotnet workload install wasi-experimental dotnet add package wasi.sdk dotnet add package Wasmtime --version 15.0.0 --安装后重新启动cmd窗
阅读全文
摘要:前段时间看到 在线原源码浏览网站 SourceBrowser,就好奇怎么读的 代码 展示的,就拔下源码 看了 下, 然后自己 打算简单实现下,不想 每个工作日 弄 个把小时 弄了两周,才解决报错问题,可以读取到 文档,也简单学习了下 Roslyc. 原项目中 时 net472 跑,我先直接copy拿
阅读全文
摘要:An error occurred while processing your request. Request ID: 00-613112becd7848f0226b77690eb71d00-3769cb0d7144d878-00 Development Mode Swapping to Deve
阅读全文
摘要:安装webview2 不然报错找不到路径,运行时也安装下
阅读全文
摘要:依赖注入 先添加要注册的对象 如 AddTransient<IA,A>()到 ServiceCollection ;然后将添加的 对象 添加到到 容器里,这里根据 添加 对象的不同,如 .AddScoped<IB>(_ => new B()),AddSingleton<IC>(new C());等然
阅读全文
摘要:using System; using System.Collections.Generic; using SqlSugar; $blankline {{ var today=new Date(); var fullYear=today.getFullYear(); var month=today.
阅读全文
摘要:Microsoft.AspNetCore.Hosting.HttpRequestIn.Start Microsoft.AspNetCore.Hosting.BeginRequest Microsoft.AspNetCore.Routing.EndpointMatched 终结点匹配 Microsof
阅读全文
摘要:在部署到西藏职院 测试 流程时(Net6), 有个在线预览功能,pc 端可以,但是在微信端预览时就报错了,提示 ERR_BLOCKED_BY_RESPONSE,百度设置x-frame-options=sameorigih,还是有问题,链接有一个 http和一个https(问题就出在这里,微信端被强制
阅读全文
摘要:1 new WebHostBuilder ,并传入 IHostBuilder 和 ApplicationBuilder 并初始化 , 执行委托 创建HttpListenerServer 服务,没有则返回默认 监听地址,注册中间件,获取监听地址, 遍历 生成管道 对象 requestDelegate
阅读全文
摘要:https/http下 授权跳转 总是不能跳转 idnentoty 4.00版本,升级版本后解决 20240623 上图错误 解决方法: 这是你 identity 的地址已填写错误,仔细检查下端口等 RedirectUris = { "https://localhost:7098/signin-oi
阅读全文
摘要:错误使用 app.UseAuthentication();//认证 这里要加,位置不能反 app.UseAuthorization();//授权 app.UseCors();//启用Cors 解决方法 app.UseCors();//启用Cors app.UseAuthentication();//
阅读全文
摘要:这个百度一大片,到处不行,国外网站找也是有问题,官网文档也是有点操蛋。搞到现在ok了 直接上代码。 //Program.cs 配置 #region 日志 LogManager.LoadConfiguration(ParameterConfig.Nlog).GetCurrentClassLogger(
阅读全文
摘要:前面还好好的,今天线上就反馈出这个问题。百度一下,就是iframe框不能返回数据,下面解决方法 解决方法一//代码中添加响应头app.Use(async (context, next) => { // Do work that can write to the Response. context.R
阅读全文
摘要:这些东西以前是知道是什么东西,但是没做记录现在就忘了,还是做下记录好点分布式:将一个大系统分为若干小系统,例如我现在的维护流程系统,简单分 可以流程一个,微信端一个。在细一点,流程后台中流程设计为一个,表单设计一个,前台流程解释执行一个.拆开部署到不同服务器支之间相互访问微服务 :也是将将服务拆分,
阅读全文
摘要:public T Query<T>(int id) where T : BaseModel { Type type = typeof(T); string columnString = string.Join(",", type.GetProperties().Select(p => $"[{p.G
阅读全文
摘要:绑定集合 var source = new Dictionary<string, string> { ["0:gender"] = "Male", //["0:age"] = "18", //["0:contactInfo:emailAddress"] = "foo@outlook.com", //
阅读全文
摘要:{ // 使用 IntelliSense 了解相关属性。 // 悬停以查看现有属性的描述。 // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ {
阅读全文
摘要:IServiceProvider 处理提供所需服务实例,有需要还会负责释放服务实例。具体操作为调试用实例的dispose或者异步dispose方法。 scoped和transient:当前Iservice provider 对象 调用dispose 方法,实例方法 dispose 也被调用,随之释放
阅读全文
摘要:public class ServicesPrpvoder:IServicesPrpvoder 服务提供者可以利用IserviceScoprFactory 创建一个 服务范围 IServiceScope对象IServicesScope 的包含IServicesPrpvoder任何一个 IServic
阅读全文
摘要:var sc = new ServiceCollection() .AddScoped<IA, A>() .AddSingleton<IB, B>() .AddTransient<IC, C>() .BuildServiceProvider(true);//ValidateScopes检查在scop
阅读全文