Comments (3)
Ups, something got lost there. Which version of ASP.NET-Core are you on?
Anyway, when below ASP.NET Core 3. You can do the following in your Startup.cs
.
public IServiceProvider ConfigureServices(IServiceCollection services)
{
// add stuff to services, like services.AddMvc();
var containerBuilder = new ContainerBuilder();
// add stuff to the containerBuilder
containerBuilder.Populate(services);
var container = container.Build();
return new AutofacServiceProvider(container);
}
I will create a PR soon to fix that.
Also, is it possible to combine
ConfigureContainer
andAddControllersAsServices()
... an example for that would be helpful as well.
What do you mean by that? Would you eloberate?
from documentation.
Actually I don't think I had a further problem, or whatever it was, I've forgotten it! Thanks!
from documentation.
Okay, then your question should be answered now. We have added a sample again on how to do it with ASPNET Core version < 3.0 and without configure container.
from documentation.
Related Issues (20)
- Update Blazor integration docs with the latest method signatures
- Compatibility with Autofac v6 HOT 1
- log4net.rst is broken HOT 2
- Update API docs for v6 HOT 2
- Clarify delegate factory docs with more commentary
- Incorrect usage of Owned<> in per-request scope example HOT 1
- Update docs to include RegisterAssemblyOpenGenericTypes HOT 1
- Clarify which properties are auto-wired
- Service resolution algorithm should be documented HOT 4
- Potential opportunity to simplify Startup.cs config in docs' Application Integration's ASP.NET Core 3.x section HOT 3
- Additional Guidance for Custom Metadata Usage HOT 2
- Latest version as number HOT 7
- Add Azure Functions integration guide HOT 1
- Document Enhancement [Code snippet not working]
- Is the important part of the IAsyncDisposable section in the disposal.rst still true? HOT 4
- Document difference of behavior that can be observed when using MS IServiceProviderFactory vs AutofacServiceProviderFactory HOT 1
- Docs for `IConstructorSelector` optimization
- More middleware examples
- Broken links in upgrade documentation HOT 1
- Please add good getting started for single program template .NET 6 project HOT 6
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 documentation.