Khi tôi cố gắng xuất bản ứng dụng xanh lam, tôi nhận được lỗi này. C: \ Program Files (x86) \ MSBuild \ Microsoft \ VisualStudio \ v14.0 \ Web \ Microsoft.Web.Publishing.targets (4283,5): Lỗi: Đối số 'ibasis_Data_Transfer.mytestdbEntities-Web.config Connection String' không được rỗng hoặc trống.Azure: Đối số chuỗi kết nối Web.config không được rỗng hoặc rỗng
App.Config của tôi có chuỗi kết nối. ví dụ.
<add name="mytestdbEntities" connectionString="metadata=res://*/mytestappModel.csdl|res://*/mytestappModel.ssdl|res://*/mytestappModel.msl;provider=System.Data.SqlClient;provider connection string="data source=tcp:srv-mytestapp-home.database.windows.net,1433;initial catalog=mytestdb;persist security info=True;user id=blabla;password=blabla;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
Không biết bắt đầu tìm kiếm giải pháp như lỗi nào không được đề cập trên web ở bất kỳ đâu liên quan đến Azure.
ibasis - Web Deploy.pubxml
<?xml version="1.0" encoding="utf-8" ?>
<!--
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
by editing this MSBuild file. In order to learn more about this please visit http://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>MSDeploy</WebPublishMethod>
<PublishProvider>AzureWebSite</PublishProvider>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish>http://ibasis.azurewebsites.net</SiteUrlToLaunchAfterPublish>
<LaunchSiteAfterPublish>False</LaunchSiteAfterPublish>
<MSDeployServiceURL>ibasis.scm.azurewebsites.net:443</MSDeployServiceURL>
<DeployIisAppPath>ibasis</DeployIisAppPath>
<SkipExtraFilesOnServer>True</SkipExtraFilesOnServer>
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
<UserName>$ibasis</UserName>
<_SavePWD>True</_SavePWD>
<_DestinationType>AzureWebSite</_DestinationType>
<PublishDatabaseSettings>
<Objects xmlns="">
<ObjectGroup Name="ibasis_Data_Transfer.ibasisLiveEntities" Order="1" Enabled="False">
<Destination Path="" />
<Object Type="DbCodeFirst">
<Source Path="DBContext" DbContext="ibasis_Data_Transfer.ibasisLiveEntities, ibasis-Data-Transfer" />
</Object>
</ObjectGroup>
</Objects>
</PublishDatabaseSettings>
</PropertyGroup>
<ItemGroup>
<MSDeployParameterValue Include="$(DeployParameterPrefix)ibasis_Data_Transfer.ibasisLiveEntities-Web.config Connection String" />
</ItemGroup>
<ItemGroup>
<_ConnectionStringsToInsert Include="ibasis_Data_Transfer.ibasisLiveEntities" />
</ItemGroup>
</Project>
Cập nhật: Theo như tôi có thể nói với việc xuất bản VS của Apps đơn giản để Azure với 'cơ sở dữ liệu đầu tiên' loại thực thể (edmx) các tập tin là không thể.
Tự động tạo .... Web Deploy.pubxml được lấp đầy với rác không tương thích như và "DeployParameterPrefix" không thể xóa và phá vỡ bản dựng.
Tôi chỉ muốn gọi Thủ tục được lưu trữ đơn giản, ví dụ:
myappLiveEntities db = new myappLiveEntities();
db.DoSomeDatabaseWork();
Sẽ làm phương pháp "trường học cũ".
Bạn có ghi đè chuỗi kết nối trong khi xuất bản không? Bạn có một chuyển đổi cấu hình đó là rối tung với chuỗi kết nối? –
_ConnectionStringsToInsert có lẽ đang làm điều gì đó nhưng không chắc chắn những gì. Nó là một thiết lập cổng thông tin? Cổng không chấp nhận các chuỗi kết nối có định dạng này: "siêu dữ liệu = res: //*/mytestappModel.csdl | res ......." – user964787
Có thể trùng lặp với [The 'DefaultConnection-Web.config Connection String' đối số không được rỗng hoặc trống. VS2013] (http://stackoverflow.com/questions/28996604/the-defaultconnection-web-config-connection-string-argument-cannot-be-null-or) –