2

This should be a simple one... but it confounds me. I am trying to test a third-party assembly using a very simple winforms app. I add a reference to it in the project. I then add an Imports (this is VB.Net) statement. I continue on to call a method in a static class within the assembly within Form1_Load. All of this is almost too much information...

Before attempting to build the solution the imports statement is fine. The call to the method is fine (and by fine I mean visual studio "sees them." When I build the solution it throws the error "'[NAMESPACE]' is not declared. It may be inaccessible due to its protection level."

I have tried removing the assembly to a more public directory. In the reference properties copy local is true.

Any ideas? I am at my wits-end over this silly problem.

Nick Birke
  • 137
  • 2
  • 12
  • Is it possible that these classes or methods you're trying to call are Protected, Internal or Private? – jessehouwing Dec 17 '14 at 14:47
  • I had the same issue a couple of times. Adding them to the project and then restarting VS helped sometimes. Maybe that helps for you as well. – WeSt Dec 17 '14 at 14:50
  • None of this helps but thanks. I should note that after trying to rebuild I can't even see it in the object browser! – Nick Birke Dec 17 '14 at 14:57
  • Here is another weird thing. When my colleague tries it in VS 2013 it works. I should note the assembly is built in Framework 2.0. (In case you are thinking it has something to do with a higher framework) Also... my visual studio is 2010. – Nick Birke Dec 17 '14 at 15:03

1 Answers1

0

I figured this out. By default my projects were targeting Framework 4 Client Profile" If I switched to the regular Framework 4... it works fine :-)

Nick Birke
  • 137
  • 2
  • 12