数据库连接字符串上载到服务器的问题 [英] Problems with database connection strings upload to server

查看:83
本文介绍了数据库连接字符串上载到服务器的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Azure和我的项目中更新了我的数据库,并在VS2012中运行了Update-Database和Update-Database -Script现在,当我发布它们时,我收到此错误并且网站根本无法启动:



I updated my databases in Azure and in my project and ran Update-Database and Update-Database -Script in VS2012 And now when I publish them I get this error and site wont start at all:

Model compatibility cannot be checked because the database does not contain model metadata. Model compatibility can only be checked for databases created using Code First or Code First Migrations.





任何想法发生了什么?





Any idea what is going on?

<connectionStrings>
    <add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnetdb;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf" providerName="System.Data.SqlClient" />
    <add name="DefaultConnectionDeploy" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=WebsiteManager;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\WebsiteManager.mdf" providerName="System.Data.SqlClient" />
    <add name="WebsiteManagerContext" connectionString="Data Source=(localdb)\v11.0; Initial Catalog=WebsiteManagerContext; Integrated Security=True; MultipleActiveResultSets=True; AttachDbFilename=|DataDirectory|WebsiteManagerContext.mdf" providerName="System.Data.SqlClient" />
    <add name="MusicContent" connectionString="Data Source=|DataDirectory|MusicContent.sdf" providerName="System.Data.SqlServerCe.4.0" />      
  </connectionStrings>

推荐答案

你应该在引号中引用你的错误信息,例如:



无法检查模型兼容性,因为数据库不包含模型元数据。只能检查使用Code First或Code创建的数据库的模型兼容性第一次迁移。 [ ^ ]



,您将看到许多深入的解决方案。我想这不是一个真正的答案,但如果我发表评论,你就不会得到一个超链接,这是一个很长的网址: - )
You should google your error message in quotes, like this:

"Model compatibility cannot be checked because the database does not contain model metadata. Model compatibility can only be checked for databases created using Code First or Code First Migrations."[^]

and you will see lots of in depth solutions. This is not really an answer, I guess, but if I posted as a comment, you''d not get a hyperlink, and it''s a long URL :-)


这篇关于数据库连接字符串上载到服务器的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆