前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >开发日志

开发日志

作者头像
喝茶去
发布2019-04-16 15:19:38
5310
发布2019-04-16 15:19:38
举报
文章被收录于专栏:知识累积知识累积

日常开发中遇到的问题记录


打开VS提示如图:

生成项目错误如图:

经排查是项目中其中一个类库找不到nuget包,将项目引用带有黄色感叹号的引用清除后,项目恢复正常


PowerDesigner16.5 增量更新数据库,不删除表数据

思路:可通过对比模型结构的方式做到增量更新数据表

选择更新之前的pd


autofac 生命周期 

1、InstancePerDependency

对每一个依赖或每一次调用创建一个新的唯一的实例。这也是默认的创建实例的方式。

官方文档解释:Configure the component so that every dependent component or call to Resolve() gets a new, unique instance (default.) 

2、InstancePerLifetimeScope

在一个生命周期域中,每一个依赖或调用创建一个单一的共享的实例,且每一个不同的生命周期域,实例是唯一的,不共享的。

官方文档解释:Configure the component so that every dependent component or call to Resolve() within a single ILifetimeScope gets the same, shared instance. Dependent components in different lifetime scopes will get different instances. 

3、InstancePerMatchingLifetimeScope

在一个做标识的生命周期域中,每一个依赖或调用创建一个单一的共享的实例。打了标识了的生命周期域中的子标识域中可以共享父级域中的实例。若在整个继承层次中没有找到打标识的生命周期域,则会抛出异常:DependencyResolutionException

官方文档解释:Configure the component so that every dependent component or call to Resolve() within a ILifetimeScope tagged with any of the provided tags value gets the same, shared instance. Dependent components in lifetime scopes that are children of the tagged scope will share the parent's instance. If no appropriately tagged scope can be found in the hierarchy an DependencyResolutionException is thrown. 

4、InstancePerOwned

在一个生命周期域中所拥有的实例创建的生命周期中,每一个依赖组件或调用Resolve()方法创建一个单一的共享的实例,并且子生命周期域共享父生命周期域中的实例。若在继承层级中没有发现合适的拥有子实例的生命周期域,则抛出异常:DependencyResolutionException

官方文档解释:Configure the component so that every dependent component or call to Resolve() within a ILifetimeScope created by an owned instance gets the same, shared instance. Dependent components in lifetime scopes that are children of the owned instance scope will share the parent's instance. If no appropriate owned instance scope can be found in the hierarchy an DependencyResolutionException is thrown. 

5、SingleInstance

每一次依赖组件或调用Resolve()方法都会得到一个相同的共享的实例。其实就是单例模式。

官方文档解释:Configure the component so that every dependent component or call to Resolve() gets the same, shared instance. 

6、InstancePerHttpRequest  (新版autofac建议使用InstancePerRequest)

代码语言:javascript
复制
在一次Http请求上下文中,共享一个组件实例。仅适用于asp.net mvc开发。
代码语言:javascript
复制
官方文档解释:Share one instance of the component within the context of a single HTTP request.

四 EF Core 项目执行时警告内存泄漏,具体如图:

目前找到一个临时解决方案:https://www.cnblogs.com/CreateMyself/p/9091304.html,具体原因还未找到

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2018-08-09 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 思路:可通过对比模型结构的方式做到增量更新数据表
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档