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
Hi,

I got the following error in my TFS Build.
AcknowledgementTest.cs(89,47): error CS0308: The non-generic method 'TypeMock.MockManager.Mock(System.Type)' cannot be used with type arguments

So I checked the build log and found that it was referencing the .NET 1.1 version of TypeMock.
/reference:"C:Program FilesTypeMockTypeMock.NET\Net11TypeMock.dll"

How do I get my build script to reference the .NET 2.0 version of TypeMock

Thanks,
Eric
asked by eschatzy (3.8k points)

7 Answers

0 votes
Hi
When you add reference to TypeMock.dll in your project you should see two versions of TypeMock.dll in the GAC the first is for .NET 1.1 and the second for .NET 2.0
Link your project to .NET 2.0 version :wink:
answered by ohad (35.4k points)
0 votes
Hi Ohad,

I agree that what you say is logical, but I have already referenced the .NET 2.0 version of TypeMock within the project. In fact just to make sure I dropped the reference and added it again. Locally, it builds with the .NET 2.0 version of TypeMock, but on the TFS Build Server it still builds with the .NET 1.1 version of TypeMock.

So I'm still stuck. :(

Eric
answered by eschatzy (3.8k points)
0 votes
Hi Eric
Are you using the AutoDeploy feature of TypeMock?
If you do please make sure you copy the right TypeMock.dll.

Note the 2.0 version is in the root install directory
default to C:Program FilesTypeMockTypeMock.NET
And the 1.1 version is in C:Program FilesTypeMockTypeMock.NETNet11
directory.

Another thing to watch when using the Auto Deploy feature is to make sure that
TypeMock directory is in the sources tree.
So the relative path to TypeMock.dll on all the machines will be identical.
answered by ohad (35.4k points)
0 votes
Hi Ohad,

I only have the Professional Version of TypeMock, so I'm not AutoDeploying. I have installed TypeMock 4.1.0 on the TFS Build server. I checked to make sure that the paths to the .NET 2.0 version of TypeMock were the same as my development computer, which they were.

The reference of TypeMock that I'm pointing to is in the GAC and I don't have TypeMock in my source tree. Do I need to do this and how does that work?

Eric
answered by eschatzy (3.8k points)
0 votes
Hi Eric
Please check the GAC in the build server under
C:WINDOWSssembly
Do you see two versions of TypeMock.dll?
answered by ohad (35.4k points)
0 votes
Yes, I have two versions of the TypeMock.dll.

I imaging one for the .NET 1.1 version and one for the .NET 2.0 version.
answered by eschatzy (3.8k points)
0 votes
Hi Eric
Hmm the plot is getting thiker :shock:
I suggest we'll take it offline
I'll send you a mail with my address for further investigation.
answered by ohad (35.4k points)
...