【发布时间】:2016-05-19 19:02:27
【问题描述】:
当我尝试发布 Azure WebJob 时出现错误:
C:\程序文件 (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.Web.Publishing.targets(4283,5): 错误: 'WebJobArchivingExpiredRequest.PixlocateEntities-Web.config 连接 String' 参数不能为 null 或为空。
但我在 app.config/connectionStrings 中有以下行:
<add name="PixlocateEntities" connectionString="metadata=res://*/DB.csdl|res://*/DB.ssdl|res://*/DB.msl;provider=System.Data.SqlClient;provider connection string="Data Source=tcp:[myserver].database.windows.net,1433;Initial Catalog=PixlocateDev;Persist Security Info=True;User ID=[username];Password=[password]"" providerName="System.Data.EntityClient" />
另外,我在 web.config 中有 2 个连接字符串:
<add name="PixlocateEntities" connectionString="metadata=res://*/DB.csdl|res://*/DB.ssdl|res://*/DB.msl;provider=System.Data.SqlClient;provider connection string="Data Source=tcp:[myserver].database.windows.net,1433;Initial Catalog=PixlocateDev;Persist Security Info=True;User ID=[username];Password=[password]"" providerName="System.Data.EntityClient" />
<add name="WebJobArchivingExpiredRequest.PixlocateEntities" connectionString="metadata=res://*/DB.csdl|res://*/DB.ssdl|res://*/DB.msl;provider=System.Data.SqlClient;provider connection string="Data Source=tcp:[myserver].database.windows.net,1433;Initial Catalog=PixlocateDev;Persist Security Info=True;User ID=[username];Password=[password]"" providerName="System.Data.EntityClient" />
为什么会发生以及如何解决?
【问题讨论】:
-
我认为错误是在谈论您的
Web.config文件 -
我在Web.Config中有相同的connectionString
标签: azure msbuild connection-string publish azure-webjobs