0
votes

I am trying to create some ASP.net 5 MVC Web Application using VS 2015 CE. I am always getting error with DNX Core and DNX 4.5 as not being referenced to the project.

I tried changing the project.json file by removing entries in "frameworks" section and keeping only one at a time from both "dnx451" and "dnxcore50", still no luck.

I ended up with the large list of compile time error primarily because of the following error.

CS1061 'ApplicationDbContext' does not contain a definition for 'Database' and no extension method 'Database' accepting a first argument of type 'ApplicationDbContext' could be found (are you missing a using directive or an assembly reference?) DemoApp.DNX 4.5.1

and on the same lines

CS1061 'ApplicationDbContext' does not contain a definition for 'Database' and no extension method 'Database' accepting a first argument of type 'ApplicationDbContext' could be found (are you missing a using directive or an assembly reference?) DemoApp.DNX Core 5.0

Tried using 'Restore Packages' command as well but nothing happens.

enter image description here

I dropped the project and re-created, however same things happened again. As far as I know it worked before and now I don't know what went wrong all of the sudden.

1
Do you have ApplicationDbContext defined in project - if so please can you add codeJames P
Have you installed ASP.NET 5 RC1 from get.asp.net?Lex Li
ASP.NET 5 RC1 and all required components are there.NBaua

1 Answers

0
votes

I resolved problem by..

  1. Deleting the project.lock.json file (figured out this was not allowing to upgrade and resolve the References)
  2. Running a DNVM upgrade command from command prompt.