ERROR:
---------------------------
Microsoft Visual Studio
---------------------------
Unable to retrieve metadata for "MvcMusicStore.Models.Album". Using the same dbcompiledmodel to create contexts against different types of database servers are not supported. Instead, create a separate dbcompiledmodel for each type of server being used.
---------------------------
Workaround:
---------------------------
First , the webconfig in the database configuration [providerName="System.Data.SqlServerCe.4.0"] 修改成 [providerName="System.Data.SqlClient" ]
添加控制器Controller;
Second, the generation controller after the [providername= "System.Data.SqlClient"] change back [ providerName="System.Data.SqlServerCe.4.0"] OK
NOTICE:
There is no second step, which means the following error will be reported if you do not revert back:
" [Win32Exception (0x80004005): The network path could not be found. ]
[SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or could not be accessed. Verify that the instance name is correct, and that SQL Server is configured to allow remote connections. (provider:named Pipes provider, error:40-Unable to open connection to SQL Server)]
”
. NET Development MVC Project Add Controller error: Unable to retrieve meta data