My client ask me something who seems me very simple to do.
He has nopcommerce 1.9 web site , and he wish develop a simple windows forms application to modify clients adresses.
So i tryed to configure a news windows forms project :
static void Main(string[] args)
{
// Code that runs on application startup
NopConfig.Init();
//initialize IoC
IoC.InitializeWith(new DependencyResolverFactory());
//initialize task manager
TaskManager.Instance.Initialize(NopConfig.ScheduleTasks);
TaskManager.Instance.Start();
//open
new FormClient().Show();
TaskManager.Instance.Stop();
}
Then i create a service manager who expose data :
public class ServiceManager
{
public ICustomerService CustomerService;
public ServiceManager()
{
var dbContext = IoC.Resolve<NopObjectContext>();
CustomerService = new CustomerService(dbContext);
}
}
And impossible to access CustomerService methods because resolve method don’t find the concrete class to instantiate for NopObjectContext;
(you can find nop commerce 1.9 in this location :
http://nopcommerce.codeplex.com/downloads/get/176949 )
Finally , it works :
App.config must be :
with program.cs file :