I'm attempting to create an ASP.NET MVC site that uses Database First Entity Framework.
I'm using creating a new MVC 5 site in Visual Studio Professional 2013 Update 3, then adding an ADO.NET Entity Data Model from which I choose EF Designer from database.
After that, I create a connection string, select the tables to generate the framework, and all is well.
However when I compile it, I receive this error
'MyModel.GlobalConfiguration' does not contain a definition for 'Configure'
This is in Global.asax.cs and errors here
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
GlobalConfiguration.Configure(WebApiConfig.Register);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
}
GlobalConfiguration
is automatically generated with the added entity framework for MyModel
. It certainly doesn't have a Configure method.
public partial class GlobalConfiguration
{
public int ID { get; set; }
public long CurrentUSN { get; set; }
public string DBVersion { get; set; }
public long CurrentFile { get; set; }
}
I followed all of the answers here GlobalConfiguration.Configure() not present after Web API 2 and .NET 4.5.1 migration but none worked. It's a slightly different situation as this isn't an upgrade but is instead a clean project.
All Extensions and NuGet packages are up to date. I've even deleted the generated entity and reinstalled all NuGet packages to see if that helped, but no luck.
Any suggestions?
Package Manager Console
for the Project with the error.Install-Package Microsoft.AspNet.WebApi.WebHost
and hit Enter.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With