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
I am getting the following exception when my test method is first entered:

Method not found: 'Void TypeMock.ArrangeActAssert.Isolate.ForceInitializeFakeLogProvider()'.

A google search turns up nothing as does a search in your forums. What am I missing??

 

asked by donniedarko (3.8k points)

3 Answers

+1 vote
 
Best answer
The answer is to remove the VisualBasic assembly and add the AAA assembly and use the lambda syntax, so if you are following the examples in the documentation you will need to follow the c# examples and convert them to VB.net. The VB.net examples assume the usage of the VisualBasic assembly (as far as I can tell).
answered by donniedarko (3.8k points)
0 votes

Hi,

Please verify that you referenced the following dlls:
 
-TypeMock.dll
-TypeMock.Isolator.VisualBasic.dll
 
(These dlls located at Typemock installation directory).
 
Let us know if it helps
 
answered by Bar (3.3k points)
edited by Bar
Thanks Bar,

Yes, I have referenced both of those typemock assemblies.

Hi donniedarko,

I think this may be related to the problem I am having described in question entitled "Tests throw TypeLoadException..."  Although I reference a different exception there, initially I was getting the same error you do about ForceInitializeFakeLogProvider.

When I got the same error as you I was using the <ClearMocks> and <Isolated> attributes at class level.  To simplify the issue, I removed those and stopped getting that error.  But I started getting the error related to TypeMock.ArrangeActAssert.AAAScopes.VBRecordScope on the first test that had any TypeMock code in it.

I suspect that, in both cases, TypeMock is trying to use the code from the C# dll to do the actual mocking, but for some reason is unable to get to it.

I also suspect that whatever solves your problem will solve mine.  If you figured out anything, please let me know...

DavidShannon,

 

Yes that is exactly what is happening to me as well. I removed the Isolated attribute from the class level which solved the ForceIniitializeFackeLogProvider error but then I also started getting the AAAScopes.VBRecordScope error. I will definitely let you know if this gets resolved as it renders the product usesless.

 

The funny thing is, in all of their documentation it does NOT tell you that you need to reference the AAA .dll, just the TypeMock Core and VisualBasic .dll's. So pretty much right out of the box this is broken for me. Frustrating.
DavidShannon - I received an email this morning explaining that the VisualBasic .dll is for projects that use "older .net versions" and in newer projects they recommend that instead of the VisualBasic.dll we use the AAA .dll so that you can use the lambda expressions. I have tried that (removing vb.net .dll and replacing with AAA .dll). I am going to try that as well as updating my syntax to the lambda syntax and see if I have better luck. Will get back to you.

They did state that the error using the VisualBasic.dll will fixed by the end of the week but still recommend using the AAA .dll instead (you will have to change your syntax).
FYI - I was able to get everything working by using the AAA assembly and changing my syntax to the lambda syntax, so if you are using a version of VB.net that supports lambdas just remove the VB assembly and add the AAA assembly, then update your syntax (follow the c# examples in the documentation, not the vb.net examples which use the visual basic assembly).

donniedarko - I got the same result with the AAA assembly.  (See "CASE 2  - VB and C# hybrid" in the Q&A at https://www.typemock.com/answers/19237/tests-throw-typeloadexception-using-typemock-syntax-version?show=19239#a19239).

The tests work, but as I mentioned in that Q&A it does not allow you to use the TypeMock Test Navigator. I was able to get everything to work, including the navigator, by putting all tests in a C# project, so that might be the better way to go if you are creating new tests.

In the meantime, I am waiting for the fix you mentioned. I have too many old tests written in the VB syntax and I really don't want to have to rewrite them.

I was told that the Test Navigator is only available in c#. Apparently the only thing available in VB is the actual mocking. No navigator or code coverage.
0 votes

We fixed it in version 8.2, which released today.

You can download it from here.

answered by Bar (3.3k points)
...