. NET in the EF framework: A connection string problem named "" is not found in the application configuration file

Source: Internet
Author: User
Tags connectionstrings

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.