2013-10-20 23 views
6

Tôi đã tìm kiếm câu trả lời nhưng không thể tìm thấy bất kỳ điều gì phù hợp với hoàn cảnh của tôi.Không thể tìm thấy Nhà cung cấp Dữ liệu Khung được yêu cầu. Nó có thể không được cài đặt.

trang web hoạt động hoàn toàn tốt khi tôi chạy nó tại địa phương, nhưng khi sau khi tôi xuất bản nó vào Azure nếu tôi cố gắng sử dụng một trang mà truy cập vào cơ sở dữ liệu nó mang lại cho tôi những trang báo lỗi sau:

Server Error in '/' Application. 
-------------------------------------------------------------------------------- 


Unable to find the requested .Net Framework Data Provider. It may not be installed. 
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.ArgumentException: Unable to find the requested .Net Framework Data Provider. It may not be installed. 

Source Error: 


An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 

Stack Trace: 



[ArgumentException: Unable to find the requested .Net Framework Data Provider. It may not be installed.] 
    System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName) +1426271 
    System.Data.Entity.Internal.LazyInternalConnection.CreateConnectionFromProviderName(String providerInvariantName) +12 
    System.Data.Entity.Internal.LazyInternalConnection.InitializeFromConnectionStringSetting(ConnectionStringSettings appConfigConnection) +101 
    System.Data.Entity.Internal.LazyInternalConnection.TryInitializeFromAppConfig(String name, AppConfig config) +32 
    System.Data.Entity.Internal.LazyInternalConnection.Initialize() +127 
    System.Data.Entity.Internal.LazyInternalConnection.get_ProviderName() +13 
    System.Data.Entity.Internal.LazyInternalContext.InitializeContext() +346 
    System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +18 
    System.Data.Entity.Internal.Linq.InternalSet`1.Initialize() +52 
    System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext() +15 
    System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider() +37 
    System.Linq.Queryable.Where(IQueryable`1 source, Expression`1 predicate) +63 
    Dota2Finder.Controllers.HomeController.Generator(Int32 Start, Int32 End) +3287 
    lambda_method(Closure , ControllerBase , Object[]) +140 
    System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +14 
    System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +182 
    System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27 
    System.Web.Mvc.Async.<>c__DisplayClass42.<BeginInvokeSynchronousActionMethod>b__41() +28 
    System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +10 
    System.Web.Mvc.Async.WrappedAsyncResult`1.End() +50 
    System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +32 
    System.Web.Mvc.Async.<>c__DisplayClass39.<BeginInvokeActionMethodWithFilters>b__33() +58 
    System.Web.Mvc.Async.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49() +225 
    System.Web.Mvc.Async.<>c__DisplayClass37.<BeginInvokeActionMethodWithFilters>b__36(IAsyncResult asyncResult) +10 
    System.Web.Mvc.Async.WrappedAsyncResult`1.End() +50 
    System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +34 
    System.Web.Mvc.Async.<>c__DisplayClass2a.<BeginInvokeAction>b__20() +24 
    System.Web.Mvc.Async.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult) +99 
    System.Web.Mvc.Async.WrappedAsyncResult`1.End() +50 
    System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +27 
    System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult) +14 
    System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23 
    System.Web.Mvc.Async.WrappedAsyncResult`1.End() +55 
    System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +39 
    System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23 
    System.Web.Mvc.Async.WrappedAsyncResult`1.End() +55 
    System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +29 
    System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10 
    System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) +25 
    System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23 
    System.Web.Mvc.Async.WrappedAsyncResult`1.End() +55 
    System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +31 
    System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9 
    System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9631764 
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155 

đây là chuỗi kết nối của tôi với tên người dùng/mật khẩu/máy chủ loại bỏ .:

<add name="DefaultConnection" providerName="System.Data.SqlClient" connectionString="Server=<server>;Database=ELO;User ID=<username>;Password=<password>;Trusted_Connection=False;Encrypt=True;Connection Timeout=30;" /> 

Mặc dù tôi không hiểu tại sao nó có thể làm việc tại địa phương nhưng không phải trên Azure. Trang web và Cơ sở dữ liệu SQL được lưu trữ trên cùng một tài khoản.

Trả lời

4

Đối với Azure tôi thấy tôi cần những chuỗi kết nối trong các định dạng sau:

<add name="connectionName" connectionString="Data Source=servername.database.windows.net;initial catalog=databasename;persist security info=True;user id=userid;password=pwd;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" /> 

Sự khác biệt chính có vẻ là Data Source=.

Xóa tên nhà cung cấp, như được đề xuất ở nơi khác, không phải là giải pháp vì chỉ đơn giản là lỗi với "providerName bị thiếu".

0

Tôi đã sửa lỗi này bằng cách đặt chuỗi kết nối trong cổng Azure thay vì dựa vào web.config đã tải lên của tôi. Điều này cũng an toàn hơn vì tôi không cần phải có một bản sao của kết nối cơ sở dữ liệu "sản xuất" trong tệp Web.Release.config của tôi. Các chuỗi kết nối được tìm thấy trong cổng quản lý Azure bên dưới tab CONFIGURE của trang web của bạn ở gần cuối trang.

Các vấn đề liên quan