ASP.NET MVC 3 - 无法找到请求的.NET Framework数据提供 [英] ASP.NET MVC 3 - Unable to find the requested .Net Framework Data Provider

查看:245
本文介绍了ASP.NET MVC 3 - 无法找到请求的.NET Framework数据提供的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

背景 - 信息:

Background-info:

我在使用微软的Visual Web Developer 2010学习前preSS。结果
我正在努力工作,通过第一个教程中发生的问题:我的(缺乏)的经验信息。

I'm using Microsoft Visual Web Developer 2010 Express.
Info about my (lack of) experience: the problem occured within the first tutorial that I'm trying to work through.

一些额外的-信息:


  • 我熟悉C#,Postgres的,Rails的(所以MVC和放大器;网络应用程序是不是新的我)

  • 我的没有与ASP.NET或SQL Server经验

  • I'm comfortable with C#, Postgres, Rails (so MVC & Web-apps are not new to me)
  • I have no experience with ASP.NET or SQL Server

问题描述:

Problem Description:

我想下面从简介ASP完全步骤.NET MVC 3 -tutorial和我遇到一个问题时的从部分5第一步 - 添加MoviesController:

I'm trying to following exactly the steps from the "Intro to ASP.NET MVC 3"-tutorial and I'm running into a problem at the first step from part 5 - Adding the MoviesController:

当我尝试添加MoviesController与在本教程中所示的确切设置,然后单击添加,我得到了以下错误:

When I'm trying to add the "MoviesController" with the exact settings that are shown in the tutorial and click 'Add' I get the following error:

无法检索元数据
  MvcMovie.Models.Movie。 无法
  找到所请求的.NET Framework数据
  供应商。
它可能没有安装。

"Unable to retrieve metadata for MvcMovie.Models.Movie. Unable to find the requested .Net Framework Data Provider. It may not be installed."

谷歌的短语无法找到请求的.NET Framework数据提供搜索的时候给了一吨的结果,但到目前为止,一切都没有解决的问题。

Google gave a ton of results when searching for the phrase "Unable to find the requested .Net Framework Data Provider", but nothing has solved the problem so far.

我已经试过:

What I've tried:

我觉得没有安装SQL服务器,所以我安装了它从视觉工作室防爆preSS ISO-得到一个错误,我已经运行从ISO修复,并声称,包括SQL Server的所有15分防爆preSS维修和放大器; .NET框架4通过成功了

I think SQL-Server was not installed so I installed it from the Visual-Studio Express ISO- got an error then I've run a repair from the ISO and it claimed that all 15 points including SQL Server Express repair &.NET 4 Framework went through successfully.

我已经运行的成功的一切The_.NET_Framework_Setup_Verification_Tool。
<一href=\"http://blogs.msdn.com/b/astebner/archive/2008/10/13/8999004.aspx\">http://blogs.msdn.com/b/astebner/archive/2008/10/13/8999004.aspx

I've run the The_.NET_Framework_Setup_Verification_Tool which succeeded for everything. http://blogs.msdn.com/b/astebner/archive/2008/10/13/8999004.aspx

所提到的(再)后安装和放大器;修理我重新创建项目,跟着每一步都在本教程中介绍,并得到了同样的错误。

After the mentioned (re-)installing & repairing I recreated the Project and followed every step as described in the tutorial and got the same error.

我发现我应该寻找在machine.config中DbProviderFactories,

I found that I should look for DbProviderFactories in machine.config,

该项目的根Web.config文件有以下条目

The root-Web.config of the Project has the following entries

  <connectionStrings>
    <add name="MovieDBContext"
     connectionString="Data Source=|DataDirectory|Movies.sdf"
     providerName="System.Data.SqlServerCe.4.0"/>

我的机器配置文件中只有一个DbProviderFactories条目:

My machine config-file has only one DbProviderFactories entry:

<DbProviderFactories>
<add name="Microsoft SQL Server Compact Data Provider" invariant="System.Data.SqlServerCe.3.5" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=3.5.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/></DbProviderFactories>

然后我发现下面的报价

then I found the following quote

我们已经改变了方式
  DbProviderFactories.GetFactoryClasses()
  确定在框架提供商
  VS2010。他们在不再列出
  machine.config文件。

"we have changed the way DbProviderFactories.GetFactoryClasses() determines the framework providers in VS2010. They are no longer listed in the machine.config file. "

从<一个href=\"http://social.msdn.microsoft.com/Forums/en-ZA/adodotnetdataproviders/thread/d79129c4-ae05-4c45-8997-bd90f5765a3a\">http://social.msdn.microsoft.com/Forums/en-ZA/adodotnetdataproviders/thread/d79129c4-ae05-4c45-8997-bd90f5765a3a

问:

Question:

因此,也许这是错误的方向,因为我不知道下一个尝试一下,我应该采取什么措施调查和放大器;解决这个问题?结果
顺便说一句。我已经安装的Postgres,因此,如果使用的是Postgres,而不是SQL服务器的将是一个简单的解决方案让我知道。对于我自己的项目,我想使用不同的DB反正(Postgres的可能),但现在我只是希望能够通过第一和看似简单的教程中,我一直在努力,顺利拿到。

So perhaps this is the wrong direction and since I have no clue what to try next, what steps should I take to investigate & solve this problem?
Btw. I have postgres installed, so if using postgres instead of SQL-server would be an easy solution let me know. For my own projects I would want to use a different DB anyway (probably postgres), but for now I would just want to be able to get successfully through the first and seemingly simple tutorial I've tried.

推荐答案

我有,所以我换成了同样的问题。

I was having the same problem so I replaced

<add name="MovieDBContext"     connectionString="Data Source=|DataDirectory|Movies.sdf"
providerName="System.Data.SqlServerCe.4.0"/>

具有以下

<add name="MovieDBContext"
     connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;database=Movies;User ID=sa;password="
     providerName="System.Data.SqlClient"/>

和它的工作足以让我继续工作。我也最终也将学会如何让这些类型的应用程序与在某些时候MySQL的,但现在至少应该帮助您继续教程。

And it worked enough to let me continue working. I too would also eventually learn how to make these kinds of applications work with mysql at some point, but for now this should at least help you continue with the tutorial.

这篇关于ASP.NET MVC 3 - 无法找到请求的.NET Framework数据提供的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆