I am migrating my Preview 5 MVC application to MVC beta and I got an error:
An error occurred while creating a controller of type 'MyApp.Controllers.HomeController'. If the controller doesn't have a controller factory, ensure that it has a parameterless public constructor.
are you using some DI frameworks with this? It seems your controller has a constructor that takes some parameters and DI cannot resolve those. (just guessing)
shapper
Contributor
3932 Points
3789 Posts
Preview 5 to Beta migration error
Oct 17, 2008 07:57 PM|LINK
Hello,
I am migrating my Preview 5 MVC application to MVC beta and I got an error:
An error occurred while creating a controller of type 'MyApp.Controllers.HomeController'. If the controller doesn't have a controller factory, ensure that it has a parameterless public constructor.
On code line in global.asax.cs:
httpHandler.ProcessRequest(HttpContext.Current);
Any idea?!
Thanks,
Miguel
bradleylandi...
Member
233 Points
109 Posts
Re: Preview 5 to Beta migration error
Oct 17, 2008 08:46 PM|LINK
Is httpHandler a custom HTTP handler that you wrote? I don't have that line in my Global.asax.cs.
panjkov
Member
529 Points
169 Posts
Re: Preview 5 to Beta migration error
Oct 18, 2008 12:43 AM|LINK
are you using some DI frameworks with this? It seems your controller has a constructor that takes some parameters and DI cannot resolve those. (just guessing)
[http://www.dragan-panjkov.com/]
shapper
Contributor
3932 Points
3789 Posts
Re: Preview 5 to Beta migration error
Oct 18, 2008 02:27 AM|LINK
I found the error. The connection string used in the DBML file was different from the connection string in Web.Config.
Thanks,
Miguel