Tuesday, 15 March 2011

Can you make dll disappear in Visual Studio?

This is more of note to myself so that I do not forget. I ran into a problem today. I am creating a simple console app, which is going to consume a dll my colleague wrote. Both are developed using VS 2010. One was developed using C# and another one developed using VB. C# main app targets 4.0 frame work, while the VB one targets 3.5 framework. References are added and started my first line of code.

VBNameSpace.VBClient client = new VBNameSpace.VBClient();

When I was writing, everything was good, Right after the namespace, VS promptly helped me with intellisense thus I know, dll is understood. I wrote just that first line and compiled the code and there it is, compilation failed with errors. The error message pertains to VBNameSpace that, it does not know where to get it from. I thought, it may be that I missed something, so I deleted the reference and added the reference again and now in the VS studio all turned blue so I know VS understood the dll. I thought it might be my mistake, I might have been seen something. Anyway, compiled again, boom the error is back. I tried various things but nothing work.

Finally Google the issue , In stack over flow got the answer. My mistake was in the project profile, my target framework was .Net Framework 4 client profile, that need to be changed to .Net Frame 4 (note, no ‘client profile’). With that change, it compiles and runs fine.

0 comments:

Post a Comment