Originally, I was following along in this ASP.NET MVC4 tutorial on using EF: http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application
Everything worked fine there, so I tried to replicate it in WPF and I can't get the localDb (MDF) file to generate.
I've tried this tutorial on EF which uses a Console app instead of ASP.NET: http://msdn.microsoft.com/en-us/data/jj193542
Again, it works fine in the Console, but trying to do it in WPF in the MainWindows.xaml.cs fails.
Any ideas?
EDIT: (I'm using VS2012 and .NET 4.5)
EDIT2: Yes, I'm getting this error:
{"'The invocation of the constructor on type 'MyProgram.MainWindow' that matches the specified binding constraints threw an exception.' Line number '3' and line position '9'."}
EDIT3: Apparently that exception above is very common and unhelpful. The solution I found elsewhere is to press CTRL + ALT + E and check every box and click OK and re run the application. Then a helpful exception shows up. (I'm still figuring out what this new one is.)
EDIT4: Well, I got it working. A call to Console.ReadLine() is illegal in WPF. Who knew? (I guess it makes sense.) Now I'm trying my own CodeFirst design and running into a different error.