Here is how:
1. Create your project (example is for windows forms)
2. Install from nuget: Autofac, Autofac.Integration.Mvc, EntityFramework.
3. Add references to: Nop.Core, Nop.Data, Nop.Services, Nop.Web.Framework (look update at the bottom).
4. ASP.NET MVC, ASP.NET Razor, ASP.NET Web Pages, Microsoft.Web.Infrastructure should be installed also.
5. Then go to your program.cs file and add:
6. Add in Main():
7. Go to your App.config file.
<section name="NopConfig" type="Nop.Core.Configuration.NopConfig, Nop.Core" requirePermission="false" />
<DynamicDiscovery Enabled="true" />
<Engine Type="" />
<Themes basePath="~/Themes/" />
Now EngineContext should initialize without exceptions. And so all services should register.
Then you use services like this anywhere in your program:
IProductService ps = EngineContext.Current.Resolve<IProductService>();
You should also create App_Data folder and move settings.txt there to have access to your database.
Also update: Better add existing projects Nop.Core, Nop.Data, Nop.Services, Nop.Web.Framework and references to them in your program than just references to already compiled dll libraries because their compilation will also cause needed packages for them to be copied to debug/release directory. Without them EngineContext will not initialize.