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
For reasons not worth going into, I have installed and uninstalled Typemock a few times on one of my development machines (x86 machine running Server 2008). Now when I install Typemock (using the latest released bits), and then launch the Isolator Configuration application to try to set my license key, I get this error message:

---------------------------
Typemock Isolator File Error
---------------------------
Warning!
Could not find file 'C: ypemockconfig.xml'.
Make sure the file exists and has read/write permission
---------------------------
OK
---------------------------

If I click OK and proceed to select the license tab, enter my license information, and click the Set License button, I get the exception below.

Thanks for any help,
Larry


System.TypeInitializationException: The type initializer for 'bn' threw an exception. ---> TypeMock.Integration.IntegrationException:
*** Value cannot be null.
Parameter name: path1
at bn..cctor()
--- End of inner exception stack trace ---
at bn.a()
at as.a..ctor()
at as.a(String A_0, String A_1)
at TypeMock.Integration.Packs.a(String A_0, String A_1, String A_2)
at TypeMock.Integration.Packs.a(String A_0, String A_1, String A_2, RegistryKey A_3)
at TypeMock.Integration.Packs.SetLicense(String productName, String licenseKey, String companyName)
at TypeMock.Runner.ConfigurationForm.j(Object A_0, EventArgs A_1)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
TypeMock.Configuration
Assembly Version: 5.2.0.0
Win32 Version: 5.2.0.0
CodeBase: file:///C:/Program%20Files/Typemock/Isolator/5.2/TypeMock.Configuration.exe
----------------------------------------
Configuration
Assembly Version: 5.2.0.0
Win32 Version: 5.2.0.0
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Configuration/5.2.0.0__3dae460033b8d8e2/Configuration.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Configuration
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
oomohura
Assembly Version: 5.2.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
plwtd68g
Assembly Version: 5.2.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
TypeMock.Integration
Assembly Version: 5.2.0.0
Win32 Version: 5.2.0.0
CodeBase: file:///C:/Program%20Files/Typemock/Isolator/5.2/TypeMock.Integration.DLL
----------------------------------------
asked by lgolding@microsoft.c (4k points)

4 Answers

0 votes
Hi Larry,

It seems that the wrong install path is written in your registry.
Please have a look at the InstallDir key on:
HKEY_LOCAL_MACHINESOFTWARETypeMockTypeMock.NET

And see if this is the case.

It should point to the directory you have installed Isolator to.
answered by dhelper (11.9k points)
0 votes
The InstallDir value is set to "C:Program FilesTypemockIsolator.2", which is correct. Also under the key HKEY_LOCAL_MACHINESOFTWARETypeMockTypeMock.NET, I see that the correct values are set for Company, CurrentVersion, and License.
answered by lgolding@microsoft.c (4k points)
0 votes
At Gil Zilberfeld's suggestion, I uninstalled Typemock, made sure all the directory c:Program FilesTypemock was entirely deleted, and entirely deleted the registry key HKEY_LOCAL_MACHINESOFTWARETypeMock. The problem persists.
answered by lgolding@microsoft.c (4k points)
0 votes
The problem was related to the fact that I have to run Typemock on two kinds of machines:

1. Developer machines, where Typemock is installed.
2. Machines that run the nightly build, where Typemock is not installed.

So I define an environment variable TypemockInstalled, which is defined on developer machines but not on build machines. My MSBuild project file looks at this environment variable. If TypemockInstalled=1, the build executes the unit tests by running the tasks
<TypemockRegister AutoDeploy="true"/>
<TypemockStart/>
<Exec Command="MSTest.exe ..."/>
<TypemockStop Undeploy="true"/>

If TypemockInstalled is not set, the build executes the unit tests by running the single task
<Exec Command="TMockRunner.exe MSTest.exe ..."/>

The problem occurred when I accidentally ran the unit tests on my development machine without setting TypemockInstalled. As a result, the <TypemockStop Undeploy="true"/> task ran, and after that I couldn't run the unit tests on that machine any more (unless I autodeployed).

Uninstalling and reinstalling didn't help until I discovered that the autodeploy process had left behind a registry key HKLMSOFTWAREWow6432NodeTypemock. Uninstalling, deleting that registry key, and reinstalling fixed the problem.

Moral: Don't use the autodeploy feature on a machine where Typemock is installed.

One remaining oddity: All of this happened on my 32-bit machine. On my 64-bit machine, where I had made the same mistake, the problem did not occur. But in any case the problem is solved and I'm back up and running.
answered by lgolding@microsoft.c (4k points)
...