type or namespace name does not exists, but it does.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,

I've got a project I've been assigned to do maintenance work on. When I
originally took it out of Source Safe it compiled just fine. I even made
changes and it compiled fine.

The project is structured as a solution containing several (7) other
solutions. One sub-solution is a utility module exporting the namespace
LotUtility, which exports a bunch of functionality through a couple of static
classes called Util and User. This sub-solution generates a file called
LotUtility1.dll and compiles just fine.

In another project called LotPresentation I have a 'using LotUtility;'
entry, and a reference to the correct .dll in the assembly. I've checked the
..dll version carefully and it is correct.

However, after compiling the LotUtility project, I can no longer compile the
LotPresentation project. All references to the Util class are not found in
the LotUtility namespace. This is so bizzare because it finds the User class
just fine.

It finds the class correctly if I fully qualify it:
LotUtility.Util.Methodname, but not with just Util.Methodname. I've removed
and re-added the reference several times.

I'm also getting the warning: Warning: The dependency 'LotUtility1,
Version=2006.55.2369.14779, Culture=neutral' in project 'LotPresentation'
cannot be copied to the run directory because it would overwrite the
reference 'LotUtility1, Version=2006.55.2369.21916, Culture=neutral'.

I have no idea what's going on here. I've also checked the text of the
..cdproj files and .sol files, and nothing seems amiss there. Of course I'm
not accustomed to reading them, so I may not know if it was.

Any ideas appreciated.

Brian
 
Brian Myers said:
Hi all,

I've got a project I've been assigned to do maintenance work on. When I
originally took it out of Source Safe it compiled just fine. I even made
changes and it compiled fine.

The project is structured as a solution containing several (7) other
solutions. One sub-solution is a utility module exporting the namespace
LotUtility, which exports a bunch of functionality through a couple of
static
classes called Util and User. This sub-solution generates a file called
LotUtility1.dll and compiles just fine.

In another project called LotPresentation I have a 'using LotUtility;'
entry, and a reference to the correct .dll in the assembly. I've checked
the
.dll version carefully and it is correct.

However, after compiling the LotUtility project, I can no longer compile
the
LotPresentation project. All references to the Util class are not found in
the LotUtility namespace. This is so bizzare because it finds the User
class
just fine.

It finds the class correctly if I fully qualify it:
LotUtility.Util.Methodname, but not with just Util.Methodname. I've
removed
and re-added the reference several times.

I'm also getting the warning: Warning: The dependency 'LotUtility1,
Version=2006.55.2369.14779, Culture=neutral' in project 'LotPresentation'
cannot be copied to the run directory because it would overwrite the
reference 'LotUtility1, Version=2006.55.2369.21916, Culture=neutral'.

I have no idea what's going on here. I've also checked the text of the
.cdproj files and .sol files, and nothing seems amiss there. Of course I'm
not accustomed to reading them, so I may not know if it was.

My guess would be that some other compiled and referenced dll uses
LotUtility also. The other dll is trying to use the older version while your
main project is trying to use the newer version. Compile the other dll also
and it should fix the problem.

Michael
 
Brian said:
I'm also getting the warning: Warning: The dependency 'LotUtility1,
Version=2006.55.2369.14779, Culture=neutral' in project 'LotPresentation'
cannot be copied to the run directory because it would overwrite the
reference 'LotUtility1, Version=2006.55.2369.21916, Culture=neutral'.

In addition to the other response, you should not directly reference
the .dll if you can avoid it. Use a project reference instead. That
way, all the dependencies can be handled better by VS. See this link:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/tdlg_rm.asp


Especially Chapter 4, "Managing Dependencies"
 
Ok, I looked for anything that might reference LotUtility. There are three
projects that reference it. LotDomain, LotPresentation, and LotEntryPoint. I
changed the reference in LotDomain to a project reference per Chris'
suggestion.

LotDomain compiles just fine. LotPresentation still fails the same way, and
LotEntryPoint depends on both of these, so it can't be compiled yet.

So far as I know there's nothing else that uses the LotUtility dll.

Thanx for the attempt though. Any other ideas out there?

Brian
 
Back
Top