Comments (3)
controller层交给autofac处理了吗?
Aspnetcore版本?
from autofac.annotation.
controller 是托管给autofac 不使用pointcut 能够正常使用,加上了就不能创建homecontroller 对象了
from autofac.annotation.
升级到最新版本 3.1.4
//这行代码代表 controller的实例的创建交给autofac容器处理
services.Replace(ServiceDescriptor.Transient<IControllerActivator, ServiceBasedControllerActivator>());
//除了上面那段代码以外,只能实现autofac去创建controller对象 ,但是必须得打【Compoment】标签注册到autofac容器才行
[Component]
public class HomeController : ControllerBase
{
}
from autofac.annotation.
Related Issues (20)
- 如何实现对IServiceProvider的属性注入直接贴[Autowired]在基类上貌似无效 HOT 1
- 拦截器最新版是去掉了吗 HOT 1
- Debug模式下,动态程序集会导致异常 HOT 2
- 并行注入多个builder.RegisterModule, Autowired标注使用的地方会出现null的情况 HOT 2
- 两个模块循环引用报错 HOT 3
- Value标签的值能从nacos里面获取吗? HOT 3
- 4.0.2升级到4.0.4的报错问题 HOT 2
- .net 4.8无法安装 HOT 2
- Component注解的InitMethod无法是父类方法 HOT 4
- Pointcut排除namespace 正则表达式如何写 HOT 3
- 如何给方法加注释,AOP中获取注释 HOT 5
- IOC注入,可以在构造函数中使用吗 HOT 5
- Autowired(name: )可以是对象属性? HOT 16
- [Pointcut(AttributeType = typeof(LogAttribute))]不起作用 HOT 3
- 子类继承父类,AOP不起作用 HOT 41
- 我想用AspectArround写一个方法自动存取缓存的AOP,当获得缓存值时,如何跳过当前方法执行下一个拦截器。 HOT 10
- 使用AspectArround做缓存时,内存一直增加 HOT 19
- 在asp.net core框架下使用[PropertySource(Dynamic = typeof(IConfigurationProvider))]无效 HOT 18
- Question about internal classes with [Component] annotation HOT 4
- asp.netcore7 razar pages中无法使用 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from autofac.annotation.