I am creating a VS2010 console app using C# language on .NetFramework 4. I got a dll from a collegue of mine, the dll was developed in VS2010 VB on .Net Framework 3.5.
I added the reference to dll in the solution. I was able to identify the class and added one line to consturct the class. The intellisense idenified the class and showed me the overloaded methods for construction. Just after one line, I compiled the code. Now the compiler can not find the dll for some reason. I am getting the error
Error 4 The type or namespace name 'MyClass' could not be found (are you missing a using directive or an assembly reference?)
The one line I added have the curvey line under the type. If I remove the dll and add it again, the line disappears as if VS found the reference. Now I build it again, I get the same error and back to square one. Is there something I am doing wrong? This happens only to this solution with this reference.
Thanks,
Check your console application project properties. If it's using the .NET 4 Client Profile and the .NET 3.5 dll is using features not in the client profile, it won't work
To fix it, change from .NET Framework 4 Client Profile to .NET Framework 4
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With