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 installed TypeMock 2.3 on my development machine using the msi and can run my unit tests with no problem using

TMockRunner.exe nunit-console.exe ....

I also want to run the unit tests as part of the build process but I don't want to install TypeMock on the build machines using the msi. I was hoping that I could just include the TypeMock files (like I do with NAnt, NUnit and FxCop) with the rest of my build files so the build package is fully self contained. When I do this, however, my tests don't run and I get the following error.

*** MockInserter not running, please run 'mocking_on.bat' before running the tests

I get this even if I run the mocking_on.bat file before the the TMockRunner command.

Is it possible to do this or must I install TypeMock using the msi? I copied every file in the folder that contains TMockRunner.exe to the build machine.

With thanks,
Adam
asked by ajd (600 points)

6 Answers

0 votes
...but I don't want to install TypeMock on the build machines using the msi. I was hoping that I could just include the TypeMock files (like I do with NAnt, NUnit and FxCop) with the rest of my build files so the build package is fully self contained...
With thanks,
Adam



Hi Adam,
It is not possible to run TypeMock without installing it on the machine. There are some components that must be registered on the computer to make it work, this is mainly due to the fact that the CLR reads these registered components, and this is not under our control, but a Microsoft dissision.
answered by scott (32k points)
0 votes
Hi Scott,

Would it possible to register the components as part of the build process? For example, I use the following command to register the NCover component during the build:

<exec program="regsvr32" workingdir="toolsNCover" commandline="/s CoverLib.dll" />
answered by IUnknown (180 points)
0 votes
Hi,
You can probrably register the components manually, although this has not been tried yet.

For the version 2.3, you would have to register:
MockWeaver.dll
ProfileLinker.dll


There is currently, no way to enter the license from the command line.
answered by scott (32k points)
0 votes
Hi Scott,

could you please state all the commands that are done by the msi installation? We have the same problem that we want to have a version of typemock in our cvs that is installed by the build process on the systems where the tests are running or developed.
What about de-installation? Should we de-install after the test has run in order to have no problems if another test on the same machine runs with an older version of typemock? Which are the commands here?
Do we have to manipulate the registry manually for the two keys mentioned in another thread or is that done during installation of the two dlls mentioned above?

Thanks in advance,
answered by mknaup (8.5k points)
0 votes
Hi,

You can always run the installer in silent mode.
:arrow: > msiexec /qn /fa typemock.msi REBOOT=ReallySuppress

If you want to hand install it. Here are the commands for version 3.0
Note: These commands might change at any time without notice.

:arrow: > gacutil /i TypeMock.dll /f
:arrow: > regsvr32 /s /c MockInserter.dll
:arrow: > regsvr32 /s /c ProfileLinker.dll

TypeMock is backward compatable and there should be no reason not to use the latest version.

:idea: Please DO NOT Manipulate the Registry keys manually.

:idea: If you do use this method of switching between different versions of TypeMock make sure that TypeMock is NOT linked to a Code Coverage tool when you perfrom the switching
answered by scott (32k points)
0 votes
:idea:
This feature is now part of TypeMock.NET version 3.5
See Auto-Deploy for Build Servers
answered by scott (32k points)
...