部署到IIS时出现连接字符串格式错误

时间:2012-11-20 18:09:15

标签: entity-framework iis connection-string

我在Web.config中有以下连接字符串:

<add name="CTRS2Entities" connectionString="metadata=res://*/Edmx.CTRS2.csdl|res://*/Edmx.CTRS2.ssdl|res://*/Edmx.CTRS2.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=SYS2-PC;Initial Catalog=CTRS2;user id=**;password=***;Integrated Security=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />

它在开发模式下运行良好。但是,当我将其部署到IIS时,我收到以下错误:

Format of initialization string does not conform to specification starting at index 0.

1 个答案:

答案 0 :(得分:0)

用单引号替换连接字符串中的&quot;值,您就是黄金。

请参阅:Keyword not supported: "data source" initializing Entity Framework Context