Today when using the EF Code First Framework, when the model is defined, want to use the package management console using Enable-migrations–force to generate the database table error, as follows;
Could not find the connection string, but I carefully read the app. Config file has a configuration file, is always error.
Workaround: Under the project's startup file, configure the connection string again. As shown, it's good to configure it again in Web. config.
Assembly Analysis: The assembly is simply the end of the compilation of the executable file, all the code will eventually be in the same place, and this place is usually in the program as a startup item in the code, so we need to be configured at the Web project.
<connectionStrings> <add name= "xgyweixin" connectionstring= "Data source=localhost;initial catalog= Xgyweixin;integrated Security=false; Persist Security Info=false; User Id=sa; password=1q2w3e4r "providername=" System.Data.SqlClient "/> </connectionStrings>
. NET in the EF framework: A connection string problem named "" is not found in the application configuration file