I "upgraded" my PC from Windows 7 to Windows 8 yesterday, so now I'm using Visual Studio 2012, and opening my Visual Studio 2010 project.
This project always worked fine, but it doesn't work in Visual Studio 2012. I had some weird errors, but I fixed those. Now I'm left with one error that I just can't fix and can't find anything about on Google:
I get this exception:
Failed to set Database.DefaultConnectionFactory to an instance of the 'System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework' type as specified in the application configuration. See inner exception for details.
With the following innerexception:
Constructor on type 'System.Data.Entity.Infrastructure.SqlConnectionFactory' not found.
My Web.Config looks pretty standard:
<connectionStrings>
<add name="DefaultConnection" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=aspnet-WebUI-201253192737;Integrated Security=True" providerName="System.Data.SqlClient" />
</connectionStrings>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework">
<parameters>
<parameter value="Data Source=.\SQLEXPRESS; Integrated Security=True; MultipleActiveResultSets=True" />
</parameters>
</defaultConnectionFactory>
</entityFramework>
The SqlConnectionFactory class exists and it has 2 constructors (one parameterless, and one that takes a connection string). I tested that by creating a SqlConnectionFactory in my C# code.
I already deleted Entity Framework and reinstalled it, but that didn't solve the problem.
I'm using Entity Framework 5.0 RC (which worked fine in VS2010 as stated before) with SQL Server 2012 + Tools and IIS express.