vb9666
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?
Do they have the same namespace ?
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.
ASKER
Dhaest,
I believe they have the same namespace. They're called the same thing under the imported namespaces. How would I check this??
I believe they have the same namespace. They're called the same thing under the imported namespaces. How would I check this??
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."
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
Imports myUtility
or just one of them?
Roger
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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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 ?
Does every class start with namespace samenameeverywhere ?
ASKER
Roger,
Thanks. Your solution worked!!
Thanks. Your solution worked!!