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
We are trying to setup out TFS 2013 environment for Typemock Autodeploy.
(We have 1 TFS project collection with several TFS Project, which use different versions of typemock.)

We followed the steps in this document from the TypeMock help:
http://docs.typemock.com/Isolator/##Ref.chm/Documentation/TFS2013Build.html
and then the 2nd section of
http://docs.typemock.com/Isolator/##Ref.chm/Documentation/TFS2012Integration.html
(Integrating Typemock Isolator per Team Project or Branch)

But... the build keeps failing, because of this error:
Exception Message: Exception has been thrown by the target of an invocation. (type TargetInvocationException)
Exception Stack Trace:    at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at System.Activator.CreateInstance(String assemblyString, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance(String assemblyName, String typeName)
   at System.AppDomain.CreateInstance(String assemblyName, String typeName)
   at System.AppDomain.CreateInstanceAndUnwrap(String assemblyName, String typeName)
   at System.AppDomain.CreateInstanceAndUnwrap(String assemblyName, String typeName)
   at TypeMock.TFS2013.BuildTasksFactory.CreateAndExecuteRegister(Dictionary`2 registerValues)
   at TypeMock.TFS2013.TypeMockRegister.ExecuteInternal(BuildTasksFactory tasksFactory)
   at TypeMock.TFS2013.TypeMockCodeActivityBase.Execute(CodeActivityContext context)
   at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
   at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

Inner Exception Details:

Exception Message: Could not load file or assembly 'TypeMock, Version=7.5.1.0, Culture=neutral, PublicKeyToken=3dae460033b8d8e2' or one of its dependencies. The system cannot find the file specified. (type FileNotFoundException)
Exception Stack Trace:    at TypeMock.CLI.Common.TypeMockRegisterInfo.Execute()
   at TypeMock.CLI.Common.TypeMockRegisterInfo..ctor()


Ik doublechecked the articles i mentioned above, but all seems to be fine and i'm running out of ideas :(


Any suggestions?

Did anyone actually got TypeMock Autodeploy working in an TFS2013 build process -environment (using version 7.5.0.19)?
asked by kvknotsenburg (3.2k points)

7 Answers

0 votes
Hi,

Please try to run with fusion log enabled on the build agent, and then search for the failure.
It should give a clue about what is happening.
answered by yoel (1.9k points)
0 votes
Fusion logging gives me this:

*** Assembly Binder Log Entry  (7-7-2014 @ 16:09:15) ***

The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.

Assembly manager loaded from:  C:WindowsMicrosoft.NETFramework4.0.30319clr.dll
Running under executable  C:WindowsMicrosoft.NETFramework4.0.30319MSBuild.exe
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: DisplayName = TypeMock.CLI.Common, Version=7.5.0.19, Culture=neutral, PublicKeyToken=3dae460033b8d8e2
 (Fully-specified)
LOG: Appbase = file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = MSBuild.exe
Calling assembly : TypeMock.MSBuild, Version=7.5.0.19, Culture=neutral, PublicKeyToken=3dae460033b8d8e2.
===
LOG: This bind starts in LoadFrom load context.
WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
LOG: Using application configuration file: C:WindowsMicrosoft.NETFramework4.0.30319MSBuild.exe.Config
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:WindowsMicrosoft.NETFramework4.0.30319configmachine.config.
LOG: Post-policy reference: TypeMock.CLI.Common, Version=7.5.0.19, Culture=neutral, PublicKeyToken=3dae460033b8d8e2
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/TypeMock.CLI.Common.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/TypeMock.CLI.Common/TypeMock.CLI.Common.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/TypeMock.CLI.Common.EXE.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/TypeMock.CLI.Common/TypeMock.CLI.Common.EXE.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v3.5/TypeMock.CLI.Common.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v3.5/TypeMock.CLI.Common/TypeMock.CLI.Common.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v3.5/TypeMock.CLI.Common.EXE.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v3.5/TypeMock.CLI.Common/TypeMock.CLI.Common.EXE.
LOG: All probing URLs attempted and failed.
(twice actually; a diff tool showed me both entries are truly identical)

What surprises me:
I'd expect the location passed to the TypeMockRegister activity, via the 'AutoDeployDir' property, to be probed too.
Or shouldn't it?

This section from the TFS build log suggestes that the location is passed correctly ($/Credi/ .. etc):
Source AutoDeploy location is '$/Credi/Credi/Main/Binaries/TypeMock'
Setting deploy directory to: C:UsersOntwSvUsTfsBuildAppDataLocalTempBuildAgentAssemblies
Typemock AppDomain base C:UsersOntwSvUsTfsBuildAppDataLocalTempBuildAgentAssemblies
TypeMockRegister, Company='ourCompany', License='ourLicence', AutoDeploy=True
 Exception Message: Exception has been thrown by the target of an invocation ....
answered by kvknotsenburg (3.2k points)
0 votes
Hi,

It looks like your installed egistered version is older than the one you're trying to load.
Meaning that you work with 7.5.0.19 but the tests are written with 7.5.1.
In order solve this you should make sure that the latest version is registered (7.5.1 at the moment).
Since this feature is only backward compatible (can't run versions greater than the registered one) always make sure that the installed egisterd version is greater or equals to the latest version you use in your tests.

Let me know if it helps.
answered by alex (18k points)
0 votes
Hi,

Thanks for the suggestion.
I checked the versions on the following locations:
- the path set for Build Controller - Version control path to custom assemblies --> Version of TypeMock.TFS2013.dll = 7.5.1.0
- my binaries folder in the appropriate branch of my TFS project: Version of TypeMock.dll = 7.5.0.19

Do you mean I should use at least 7.5.1.0 in my project ?

I figured equal versions wouldn't hurt, so I upgraded my local version tot 7.5.1.0 and replaced the appropriate assemblies in my project with the updated ones.
Then ran a new build, but got the axact same results :(

What am I / are we overlooking?
answered by kvknotsenburg (3.2k points)
0 votes
We're looking into it, I'll update you when we find something
answered by alex (18k points)
0 votes
While thinking about it and rereading this topic from start I noticed a question of mine that didn't seems te get attention.

But the more i think about it, the more relevant it seems:
Fusion logging gives me this:
...
I'd expect the location passed to the TypeMockRegister activity, via the 'AutoDeployDir' property, to be probed too.
Or shouldn't it?
...

Isn't this the heart of the issue?
answered by kvknotsenburg (3.2k points)
0 votes
Hi,

It should indeed probed this path.
You can check whether the registration suceeded by opening HKEY_LOCAL_MACHINESOFTWAREWow6432NodeTypeMockTypeMock.NET in the registry.
The installDir key should be set to your autodeploy folder.

You can also run the tests on your build machine using TMockRunner (from the autodeploy folder) in order to understand wheather it's a deployment issue or a TFS configuration issue.

Let me know if TMockRunner works.
answered by alex (18k points)
...