chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male
Welcome to Typemock Community! Here you can ask and receive answers from other community members. If you liked or disliked an answer or thread: react with an up- or downvote.
0 votes
I have just installed VS.Net 2005 professional. I upgraded one of my vs.net 2003 solutions. All the references to TypeMock objects will not work with the upgraded verison. I have removed and readded the TypeMock reference, but none of the TypeMock object are available and they dont appear with Intellisense either.

This is the compile error I am getting:

The type or namespace name 'MockObject' could not be found (are you missing a using directive or an assembly reference?)

any ideas?
asked by jnapier (9.6k points)

7 Answers

0 votes
Hi,
What version of TypeMock are you using?
What version is the TypeMock reference? (Look in Properties View)
Do you have the TypeMock menus in the Tools Menu?
answered by scott (32k points)
0 votes
Im using version 3.0.1.0 and it says 3.0.1.0 in the properties window.

Yes I do have the TypeMock Menus in the tools menu.

When I first installed vs.net 2005, on my first time opening the application, I got an error stating that the TypeMock add in could not be loaded or something like that. I uninstalled TyeMock and reinstalled it and I didnt get the error again, but now I am faced with this problem.

A colleague of mine got the same problem after he installed vs.net 2005.
answered by jnapier (9.6k points)
0 votes
This is very strange.

What versions are installed in the GAC?
Are you references 'Copy Local'? (Property View)
If so what version do you have in the 'bin' directory?
What is the Path of the reference? (Property View)

How did your colleague solve this?
answered by scott (32k points)
0 votes
I created a new project and was able to reference TypeMock just fine, so this made me think that something was fishy with the particular project that was upgraded. I started snooping around the project file and found this

 <Reference Include="TypeMock, Version=3.0.1.0, Culture=neutral, PublicKeyToken=3dae460033b8d8e2">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>............Program FilesTypeMock.NETTypeMock.NETTypeMock.dll</HintPath>
      <Private>False</Private>
    </Reference>


Notice the <Private> element. This wasn't included in the new project that I created. I removed the private element and everything worked.

It must be a bug with the 2003 -> 2005 upgrade process.
answered by jnapier (9.6k points)
0 votes
Thanks for sharing this with us :D
answered by scott (32k points)
0 votes
I have the very same problem. The transition was not between Visual Studio 2003 to 2005, but between TypeMock 3.0.0 and 3.0.1

Everything was compiling pretty good til I update to 3.0.1 Now the compilation does not work any more saying the same:

The type or namespace name 'MockObject' could not be found (are you missing a using directive or an assembly reference?)

What more strange is: on the project file everything seems correct but when I open the project in the IDE, it presents another path (takes the exe file instead of the dll file), changes copy local from false to true, and says that the file is not strong named.

I am in hurry with this. Please help

Felipe Lopez
answered by felipe2050 (1.6k points)
0 votes
I have sent a fix offline, I hope that it helps
answered by scott (32k points)
...