2013-04-23 1 views
6

ASP.NET MVC 3 (here 찾기)을 완료 한 후 온라인으로 응용 프로그램을 게시하려고했습니다. MVC 3 앱을 호스팅 할 수 있는지 여부를 확인하기 위해 호스팅 업체에 연락했습니다. 하지만 bin (dll 파일) 응용 프로그램을 배포해야했습니다. 그래서 hanselmans blog에 대한 몇 가지 단계를 수행 한 후, 나는 다음과 같은 오류에 갇히지 해요 :요청한 .Net Framework 데이터 공급자를 찾을 수 없습니다. 설치되지 않았을 수도 있습니다

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) +1420503
System.Data.Entity.Internal.LazyInternalConnection.TryInitializeFromAppConfig(String name) +362
System.Data.Entity.Internal.LazyInternalConnection.Initialize() +49
System.Data.Entity.Internal.LazyInternalConnection.get_ConnectionHasModel() +10 System.Data.Entity.Internal.LazyInternalContext.InitializeContext() +265 System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +17
System.Data.Entity.Internal.Linq.InternalSet 1.Initialize() +62
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.OrderByDescending(IQueryable 1 source, Expression 1 keySelector) +66
MvcMusicStore.Controllers.HomeController.GetTopSellingAlbums(Int32 count) +420 MvcMusicStore.Controllers.HomeController.Index() +47
lambda_method(Closure , ControllerBase , Object[]) +40
System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +17
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary
2 parameters) +188
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27

어떤 도움에 감사드립니다. 내 경험에서

+0

을 Entity Framework를 사용하고 있습니까? – mattytommo

+0

예, 정확히이 튜토리얼에서 언급 한 내용입니다. – SamekaTV

+1

Copy Local = True를 Entity Framework 참조에 추가 했습니까? – mattytommo

답변

11

는, 그 오류가 당신의 Web.config의 연결 문자열에 providerName 속성의 값이 부정확하거나, 그대로이 설치되어 있지 공급자 중 하나입니다 것을 의미한다. providerName이 개발 중에 흔하지 않은 System.Data.SqlServerCe.4.0 (SQL Server Compact)으로 설정된 경우 웹 호스트에 설치되지 않았 음을 보증 할 수 있습니다. Visual Studio 내에서만 개발 용으로 사용됩니다. 실제 SQL Server 공급자 (System.Data.SqlClient)로 변경하면됩니다.

+1

연결 문자열을 확인하여 서버 이름 및 인증 정보가 올바른지 확인하십시오. –

2

문제가 해결되었습니다.

나는 providerName에 공백이 있습니다. 그래서, .net 프레임 워크는 데이터베이스와 연결 문자열을 estblish 수 없습니다.

connectionString 태그 속성 값을 확인하십시오. providerName이 제대로 정의되지 않았을 수 있습니다. providerName 값에 여분의 문자 및 공백을 허용하지 마십시오.

0

나는 비슷한 이슈에 직면 해있다. 거기에는 아주 재미있는 솔루션이있다. 그냥 ConnectionString을 들여다 보아라. - 당신이 다른 ASP.Net 앱을 위해 사용한 것과 동일하다면, 그렇게해서는 안된다. .. 당신이 차이를 식별 할 수

<add name="EmployeeContext" connectionString="Server=.\SQLEXPRESS;Database=DB1;User Id=user1;password=password1;" providerName="System.Data.SqlClient"/> 

하나의 작은 - - .. 엔티티 프레임 워크는 다른 경우를에 모두

<add name="EmployeeContext" connectionString="Server=.\SQLEXPRESS;Database=DB1;User Id=user1;password=password1;" providerName="System.Data.SqlClient**;**" /> 

변경을주지 않습니다이 더 ';' ProviderName의 끝에 ... 예, 차이가 있습니다. 대소 문자를 구분하지 않았지만 ProviderName의 동일한 복사본과 같아야합니다. 하지만 그건 내 문제

0

또 다른 데이터 포인트 ... 내가 오라클과 엔티티 프레임 워크와 함께 작동

를 해결했다. 이 문제로 인해 Oracle ODP.NET, Managed Driver를 설치했습니다. NuGet 패키지 관리자에서

Install-Package Oracle.ManagedDataAccess 

그것은 적절한 조립 정보와 DbProviderFactories와의 App.config를 업데이트합니다 입력합니다. VS 2015, Entity Framework 6을 사용하고 있습니다. Oracle Developer Tools도 설치했습니다.

+0

안녕하세요 @ 제프. 나는 현재 IIS 8.5에 사이트를 배포하는 동안 동일한 문제에 직면하고 있습니다. 이걸 확인해 주시겠습니까 http://stackoverflow.com/q/42090440/1839005. 당신의 소중한 제안을 감사하십시오. – bkr

0

오류는 완벽했다, 그리고 코멘트 위의 좋은하지만 내 경우에는 내가 그대로 web.config 파일에 잘못된 공급자 철자 : System.Data.SqlClinet하지 의 System.Data.SQLClient

관련 문제