发布Azure WebJob

时间:2016-05-19 19:02:27

标签: azure msbuild connection-string publish azure-webjobs

当我尝试发布Azure WebJob时出现错误:

  

C:\ Program Files   (86)\的MSBuild \微软\ VisualStudio的\ v14.0 \网络\ Microsoft.Web.Publishing.targets(4283,5):   错误:   ' WebJobArchivingExpiredRequest.PixlocateEntities-Web.config连接   字符串'参数不能为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=&quot;Data Source=tcp:[myserver].database.windows.net,1433;Initial Catalog=PixlocateDev;Persist Security Info=True;User ID=[username];Password=[password]&quot;" 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=&quot;Data Source=tcp:[myserver].database.windows.net,1433;Initial Catalog=PixlocateDev;Persist Security Info=True;User ID=[username];Password=[password]&quot;" 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=&quot;Data Source=tcp:[myserver].database.windows.net,1433;Initial Catalog=PixlocateDev;Persist Security Info=True;User ID=[username];Password=[password]&quot;" providerName="System.Data.EntityClient" />

为什么会发生以及如何解决?

1 个答案:

答案 0 :(得分:0)

在“发布”向导中的“设置”&gt;&gt;下;数据库,取消选中&#34;在运行时使用此连接字符串&#34;。