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
0 votes
TypeMock 3.7.1 was working fine in our build server with CCNet, NCover and Nunit and there were no issues. In our build server we do not install any tools.

Recently we attempted to use TypeMock 4.0.3. Our projects refer to the Net 1.1 version of the TypeMock.dll in the Net11 folder. But still we get System.IO.FileNotFoundException and invalid file format errors as below. It looks like it is trying to use the Net 2.0 version of TypeMock.

Currently we have reverted back to 3.7.1 version. Anyone seen this issue?


External Program Failed: regsvr32 (return code was 5)
The format of the file 'TypeMock' is invalid.
Nested build failed. Refer to build log for exact reason.

Internal Error: System.BadImageFormatException
The format of the file 'TypeMock' is invalid.

at d.b()
at TypeMock.NAntBuild.TypeMockRegisterTask.ExecuteTask()
at NAnt.Core.Task.Execute()
at NAnt.Core.TaskContainer.ExecuteChildTasks()
at NAnt.Core.Tasks.IfTask.ExecuteTask()
at NAnt.Core.Task.Execute()
at NAnt.Core.Target.Execute()
at NAnt.Core.Project.Execute(String targetName, Boolean forceDependencies)
at NAnt.Core.Tasks.CallTask.ExecuteTask()
at NAnt.Core.Task.Execute()
at NAnt.Core.Project.InitializeProjectDocument(XmlDocument doc)
at NAnt.Core.Project.Execute()
at NAnt.Core.Project.Run()
asked by vamarnat1 (640 points)

3 Answers

0 votes
When Auto-deploying TypeMock you must copy required files to a specific location (these files can then be checked into your repository).

So when you want TypeMock to run with .NET 1.1, you must copy the TypeMock.dll that is in the Net11 Directory of the TypeMock installation.
answered by scott (32k points)
0 votes
Hi Scott,
Yes we did that. But NCover-Nunit is not recognizing that. It was still looking for 2.0 version of the file.

Here is something on the developer box where we have installed 4.0.3.
The csproj still referes to the Net11 folder TypeMock.dll. But we get the same error with Nant build in the NCover-Nunit. It uses the installed version 2.0 of the TypeMock.dll for some reason.
answered by vamarnat1 (640 points)
0 votes
Can you tell me what version of visual studio you have installed?
(both on developer machine and on build server)
answered by lior (13.2k points)