Referenced Assembly could not be resolved because it has a dependency


“Warning 3 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. WindowsApplication1” 

So I’ve been trying to add an assembly (DLL) that I created to a new project using the .Net Framework 4.0 and Visual Studio 2010. I add my reference to the new project but alas, the intellisense in Visual Studio doesn’t recognize any of the namespaces in the assembly nor does any code that references it compile. If you remove the code but still have the reference it will compile. I noticed that I did have compiler warnings and the above message was one of them. The key in this message is the Profile=Client. By default, Windows Forms apps are setup to target the “client project” which is a subset of the full Framework that has a much smaller footprint. When I changed my project to use the full .Net Framework 4.0 I was able to reference my assembly. To change this setting to go Project-><your project name> Properties->Compile Tab->Advanced Compile Options Button->Target Framework Dropdown.

Leave a comment

Please note that we won't show your email to others, or use it for sending unwanted emails. We will only use it to render your Gravatar image and to validate you as a real person.