Public function in public class unrecognized in a project it is referenced

I have a utility dll that I have created.  The classes are set to public as well as the functions.  I can access them in one project but not in another.  Both projects are included in the same solution and both have references to the same utility dll.  However, one of them recognizes a class with some public functions in the public class while another one the intellisense doesn't even pickup the class name.  Any thoughts on why it works in one but not the other?
vb9666Asked:
Who is Participating?
 
SanclerCommented:
I've tried to reproduce this on my system, but not had any success.

From the various bits of description scattered through the posts, the most likely thing looks to me to be a corruption (or, as gjutras suggested, maybe a syntax error) somewhere.  Given that it is working okay when referenced from one of the projects, I would tend to delete the reference from the other project then Save.  Then close out Visual Studio and delete the bin and obj folders for the project concerned: they will be regenerated on re-opening and re-filled on a build.  That approach should wipe out any corruption in the project files themselves and, given that the reference works OK in the other project, that seems the most likely source.

Then re-open, put the reference into the offending project again, and see whether that then allows a proper Imports statement in that project.  When doing that you want to check that the reference in the offending project is identical to that in the one that works.  You can do this - a bit tediously - by clicking on the references in the two projects and checking in the properties window under each entry.  Most of the entries will be greyed out, but you can still read them.  That should cover the point made by Dhaest.

Roger
0
 
DhaestCommented:
Do they have the same namespace ?
0
 
gjutrasCommented:
there might just be a syntax error in the project that you're working on that needs to be fixed first.  Sometimes simple syntax errors keep intellisense on referenced projects from working.
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

 
vb9666Author Commented:
Dhaest,

I believe they have the same namespace.  They're called the same thing under the imported namespaces.  How would I check this??



0
 
vb9666Author Commented:
gjutras,
I do have some warnings but no errors in the project.  The warnings are a bit odd and don't even reference a certain file, line and column.  Could this be the issue?

Example of one of the warnings is: "At least one of the arguments for 'OLE.get_Value' cannot be marshaled by the runtime marshaler.  Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate."
0
 
SanclerCommented:
Do both projects begin with

Imports myUtility

or just one of them?

Roger
0
 
vb9666Author Commented:
Roger,

On the one that is working, I have it is

Imports myUtility.myClass

On the other one, it doesn't even recognize 'myClass'

When I type this it gives me the following warning:
Namespace or type specified in the Imports 'myUtility.myClass' doesn't contain any public member or cannot be found.  Make sure the namespace or the type is defined and contains at least one public member.  Make sure the imported element doesn't use any aliases.
0
 
DhaestCommented:
If you take a look at the class-view of your project, do you see one or more main-entries ?
Does every class start with namespace samenameeverywhere ?
0
 
vb9666Author Commented:
Roger,

Thanks.  Your solution worked!!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.