Friday, June 15, 2012

The referenced assembly could not be resolved because it has a dependency on "System.Data.OracleClient, Version=4.0.0.0

One of my friend was having trouble in compiling the application.  He saw the following warning message in Visual Studio. Since he was accessing the SQL server he neglected it. He didn't reference Oracle from any of his projects in the solution. He emailed me the solution , I checked the code and dint find anything wrong there.


The referenced assembly 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". Please remove references to assemblies not in the targeted framework or consider retargeting your project




Solution:


Change the application Framework Target from .Net Framework Client Profile to Main

Root Cause:
.NET Framework 4 Client Profile does not include .NET Framework Data Provider for Oracle. Since Microsoft.Practices.EnterpriseLibrary.Data has a reference to System.Data.OracleClient this error is thrown.

No comments:

Post a Comment