我有这些文件:
网页配置
<connectionStrings>
</connectionStrings>
Web.Debug.config
<connectionStrings>
<add name="Elite.DAL.MainContext"
connectionString="Data Source=FISH\SQLEXPRESS;Initial Catalog=Elite;Integrated Security=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
Web.Releas.config
<connectionStrings>
<add name="Elite.DAL.MainContext"
connectionString="Data Source=1LEINTRA\SFSQL;Initial Catalog=Elite;Integrated Security=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
难道我做错了什么?
当我使用 Web-Deploy 发布时,我得到了这个:
<connectionStrings>
<add name="Elite.DAL.MainContext" connectionString="Elite.DAL.MainContext_ConnectionString" providerName="System.Data.SqlClient" />
<add name="Elite.DAL.MainContext_DatabasePublish" connectionString="Elite.DAL.MainContext_DatabasePublish.ConnetionString" providerName="System.Data.SqlClient" />
</connectionStrings>
Format of the initialization string does not conform to specification starting at index 0.
此外,当我发布时,我选择运行第一个代码迁移,但未创建表,这是初始迁移的一部分。
<contexts>
<context type="Elite.DAL.MainContext, Elite">
<databaseInitializer type="System.Data.Entity.MigrateDatabaseToLatestVersion`2[[Elite.DAL.MainContext, Elite], [Elite.Migrations.Configuration, Elite]], EntityFramework, PublicKeyToken=b77a5c561934e089">
<parameters>
<parameter value="Elite.DAL.MainContext_DatabasePublish" />
</parameters>
</databaseInitializer>
</context>
</contexts>