Click here to Skip to main content
15,892,839 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Im hoping someone has come across this before

I have a compiled VB.net 2008 Dll which works fine, I use standard blocks of code for all of my projects including the dll.

When I create a new app and import the Dll I get the following error when checking contents of some variables.

"g_DataFile' is ambiguous between declarations in Modules localApp and CompiledApp"

I understand that it is a clash between variables and only occurs when I try to use the immediate window to show the variable contents. But I would like to hide the vars in the dll but the compiled dll seem to be expose them.


Any help would be appreciated

Thanks
Posted
Comments
Sergey Alexandrovich Kryukov 20-Jan-15 12:55pm    
Absolutely every name clash is resolvable. First are the type names 100% identical, or namespaces are different. The resolution can be done even of full names are identical, which is just a tiny bit more difficult.
—SA
derekbeacroft 21-Jan-15 5:51am    
Ahh Namespaces, I come from 12yrs vb6 and 2 yr .Net so not so great on namespaces
my dll uses a RootNamespace of "UserSecurity"

My app uses a Rootnamespace of "QuotesApplication"

in my app I add "Imports UserSecurity"

Not really sure how to resolve it though, the vars are public in the module Code, should I move them elsewhere ??

Dez
Sergey Alexandrovich Kryukov 21-Jan-15 11:29am    
This is irrelevant. I'm not asking what you added, what you used and what are your namespaces, I am asking full names of clashing types, are they 100% identical or not. On cannot be "so great on namespaces" or not "great". You just know them or not. If not, you are not doing programing in .NET. Not at all, nothing to bother about, nothing to talk about. Learn it and come back. I just don't want to confuse you with more difficult cases, when the names are exactly the same.
—SA
derekbeacroft 21-Jan-15 11:40am    
Well that's a useful comment, I hope some of the other people on this forum are a little more helpful.

"Learn it and come back"

Why do you think this forum exists ?


But thanks for your comments no mater how unhelp full you are.
Sergey Alexandrovich Kryukov 21-Jan-15 11:56am    
Hm. I see you are frustrated. Sorry. But then answer our questions, it's way to easy.
Forum exist for people qualified to ask questions and use the help. Everything has its prerequisite. You cannot hope for help if you don't know the terms to discuss the matters.
But of course, if it was just misunderstanding, I'll gladly admit my fault and apologize.

So, all you need is to find out the declarations of "g_DataFile". You have at least two, in different places. This should be fine, but then you need to find out how are they different. Full type name in one case, full type name in another case. They can be both defined in your code, one can be in one library, both in some libraries you are trying to use, and so on. Two clashing full names. I just asked not the names, but if they are identical or not.

Is that clearer, or..?

—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900