Link to home
Start Free TrialLog in
Avatar of vb9666
vb9666Flag for United States of America

asked on

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?
Avatar of Dirk Haest
Dirk Haest
Flag of Belgium image

Do they have the same namespace ?
Avatar of gjutras
gjutras

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.
Avatar of vb9666

ASKER

Dhaest,

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



Avatar of vb9666

ASKER

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."
Do both projects begin with

Imports myUtility

or just one of them?

Roger
Avatar of vb9666

ASKER

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.
ASKER CERTIFIED SOLUTION
Avatar of Sancler
Sancler

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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 ?
Avatar of vb9666

ASKER

Roger,

Thanks.  Your solution worked!!