Welcome to Typemock Answers. Here you can ask and receive answers from other community members. And if you liked or disliked an answer or thread: react with an up- or downvote Enjoy!

Null value in TypeMock.CLI.Common.TypeMockStartInfo

0 votes
Hi all,

On each of the buildagents that I use (Windows Server 2012 R2 with TFS 2013 U2) I receive the following error when I try to run my TypeMock-enabled builds. Could someone indicate where to look for a possible solution? I am using the latest 7.5.6 version.

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.CreateStart(Dictionary`2 startValues)
   at TypeMock.TFS2013.TypeMockStart.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: Value cannot be null.
Parameter name: path1 (type ArgumentNullException)
Exception Stack Trace:    at System.IO.Path.Combine(String path1, String path2)
   at Configuration.AutoLinkSession.StartGlobalSession()
   at TypeMock.CLI.Common.TypeMockStartInfo.Execute()
   at TypeMock.CLI.Common.TypeMockStartInfo..ctor()
asked Oct 16, 2014 by rpaardekam (680 points)

17 Answers

0 votes
Hi,

It looks like the start task runs without the register task (the outodeploy property in 5 is not set).
Are you using Typemock template for TFS2013?

 

Alex Galin | Support Team

answered Oct 20, 2014 by alex (17,910 points)
0 votes
Hi Alex,

thanks for your reply. We are not using the example template, we created our own. The instructions in the link you mentioned were followed in every detail, see snippet of our custom template attached. Any other thoughts what is causing this error? The error is not very informative to a TypeMock user. I would think that if this is related to not registering correctly, a more specific message would be displayed?

TypeMockNullValueError.PNG (The TypeMock elements in my Build Template)
answered Oct 21, 2014 by rpaardekam (680 points)
0 votes
Hi Alex,

based on your response that my problem is related to TypeMock not being registered correctly, I have done some more digging. I first created a simple build definition based on the default v12.0 template that comes with the TypeMock application. That worked just fine and the detailed properties of the TypeMockRegister activity is attached below.

TypeMockRegisterOK.PNG (TypeMock registered OK with default TypeMock template)

After that I checked the detailed properties for my custom build process template and indeed it seems that TypeMock is not able to translate the assembly-folder from TFS to the correct path on disk. Please advise on how to overcome that issue: all properties are identical and the register-command does receive all 3 properties (AutoDeployDir, Company, License) just fine. Howcome it is not able to translate the TFS-path in my template?

TypeMockRegisterError.PNG (TypeMock register ERROR with custom TypeMock template based on TFS 2013.)

Thanks in advance for your guidance.
answered Oct 21, 2014 by rpaardekam (680 points)
0 votes
Hi,

Thank you for the detailed feedback.
Just to make sure, have you set your "version control path to custom assemblies" as described in section 7?

 

Alex Galin | Support Team

answered Oct 21, 2014 by alex (17,910 points)
0 votes
Hi Alex,

yes I did. See attached image. I am more-or-less out of ideas currently. I don't like to write some kind of custom activity to workaround this issue. I have manually copied all relevant TypeMock files in the "temp local appdata folder" illustrated in my previous reply and that did work. Of course that's not a feasible solution. Any other thoughts?
TypeMockControllerCustomAssemblies.PNG (Custom Assemblies on my 2013-controller)
Thanks again.
answered Oct 21, 2014 by rpaardekam (680 points)
0 votes
Hi,
We're looking into it.
I'll update here as soon as progress.

 

Bar David | Support Team

answered Oct 22, 2014 by Bar (3,540 points)
0 votes
Thank you Bar. I am anxiously looking forward to your reply as my current builds are not getting better by trying to workaround it. Would you be able to give a rough estimate on when you expect to find more details?
answered Oct 23, 2014 by rpaardekam (680 points)
0 votes
Bar, Alex: are you aware that the "new TFS 2013 template" that Microsoft provides is very different from the template that you provide with Typemock? I was under the impression that the file provided (DefaultTemplate.12.0.WithTypemock.xaml) was based on the "vanilla template" TfvcTemplate.12.xaml that Microsoft provides in TFS 2013 but that is definitely not the case. The workflow and build-system in version 12.0 (so VS 2013) is completely different from the previous versions. If you compare the two templates you will see huge differences. Shouldn't these be aligned? My builds are currently on hold because of this issue, can this be addresses on short term please?
answered Oct 28, 2014 by rpaardekam (680 points)
0 votes
Hi,

Thank you for let us know about it.
Our template is based on the first template provided by Microsoft in TFS2013, we were not aware that they updated it.
We're trying to understand if it affects the instructions on how to update your template, especially the maping to AutoDeploy dir (your issue).
This case is high priority and we'll update you ASAP.

 

Bar David | Support Team

answered Oct 28, 2014 by Bar (3,540 points)
0 votes
Hi,

So... turns out that there is a new template :shock:. Thanks.

We're now working on customizing it with our activities.
Also, since the build\xml order is different in the new template, will make a new doc on how add our activities your cusstom template.

We also discovered that there's an actuall bug in mapping the AutoDeploy folder (instead the custom activities folder).
Richard metioned a workaround for this issue, and we are also working on it.
Ill keep you posted as soon as possible.

 

Bar David | Support Team

answered Oct 29, 2014 by Bar (3,540 points)
...