为什么没有System.Data.OracleClient的在.NET 4.0中客户端配置文件可用?配置文件、客户端、Data、System

2023-09-03 06:34:26 作者:咎

所以,我在一个项目,该项目是框架2.0下构建版本的Visual Studio 2005我的工作。现在我把这个项目到Visual Studio 2010 SP1下的版本,新的版本,并开始实现扔这个错误和警告的相关性,例如:

So I'm working in a project which are build in the version visual studio 2005 under the framework 2.0. Now I moved the project to the new version of the visual studio 2010 sp1 under the version and start to realize the are throwing this errors and warnings with the dependencies, for example

Warning 1 could not be resolved because it has a dependency on "System.Data.OracleClient, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which is not in the currently targeted framework ".NETFramework,Version=v4.0,Profile=Client". 

我带来的后果是,应用程序不读取我添加了参考,但改变的框架。 框架4.0 的问题是解决了。测试我更改为的.NET Framework 4.0客户端配置文件,我意识到了构建错误和警​​告再次出现。

Bring me the consequence that the application doesn't read the reference that I added, but changing the framework. .Net framework 4.0 the problem was solve. Testing I change the to .net framework 4.0 client profile and I realized the the build errors and warnings appears again.

现在我的问题是,为什么制定 .NET 4.0 的作品,而不是与客户端配置文件?我需要因为我不是在这部分专家一个很好的解释。

Now my question it's why setting .net 4.0 works and not with the client profile?? i need a good explanation because I'm not a expert in this part.

推荐答案

的客户端配置文件仅包括整个.NET框架的一个子集,一个子集应足以使桌面应用程序,而使其更容易引入.NET与您的应用程序。

The Client Profile only includes a subset of the whole .NET framework, a subset that should be sufficient to make desktop applications, while making it easier to redistribute .NET with your application.

如上文博客中介绍了客户端配置文件,Oracle客户端功能不包含在客户端配置文件。这可能是因为 Oracle客户端是德precated作为.NET 4 (相同的版本,介绍客户端配置文件),你应该逐步淘汰完全使用它。 (这也可以说是没有真正适合列入的客户端配置文件反正。)

As mentioned in a blog post introducing the Client Profile, the Oracle Client feature isn't included in the Client Profile. This is likely because Oracle Client is deprecated as of .NET 4 (the same release that introduces the Client Profile), and you should phase out using it altogether. (It's also arguably not really appropriate for inclusion in the Client Profile anyway.)

如果你需要从你的应用程序连接到Oracle,您应该针对完整的.NET框架,或preferrably使用第三方Oracle驱动程序,那将熬夜到最新。 (约去precation的相关的文章列出了几个替代方案。)

If you need to connect to Oracle from your application, you should either target the full .NET framework, or preferrably use a third-party Oracle driver that's going to stay up-to-date. (The InfoQ article about the deprecation lists several alternatives.)