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
I'm just getting started with an evaluation of TypeMock and I'm having an issue.

If I create a Test project and add references to TypeMock Isolator Core DLL and TypeMock C# APIs that works fine. But if i create a new WPF Application project and want to add TypeMock support to it then I have problems. Just adding TypeMock Isolator Core DLL and TypeMock C# APIs results in the build failing with:

C:WINDOWSMicrosoft.NETFramework4.0.30319Microsoft.WinFX.targets(269,9): error MC1000: Unknown build error, 'Cannot resolve dependency to assembly 'Configuration, Version=7.0.0.0, Culture=neutral, PublicKeyToken=3dae460033b8d8e2' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.'

Adding a reference to C:Program FilesTypeMockConfiguration.dll then results in the following warning:

warning CS1685: The predefined type 'System.Runtime.CompilerServices.ExtensionAttribute' is defined in multiple assemblies in the global alias; using definition from 'c:Program FilesReference AssembliesMicrosoftFramework.NETFramework4.0System.Core.dll'

Am I going about this all wrong? What is the best way to add TypeMock support to an existing application?

FYI Using VS2010 and I have TypeMock Auto-Runner and TypeMock Test Lint add-ins disabled as I was getting an exception when launching VS.
asked by John Doe (3.2k points)

8 Answers

0 votes
Hi,

Are you trying to add references to Isolator from the WPF project which is the code under test? If so, it's unnecessary and references are required in the test projects only.

Regarding the ExtensionAttribute conflict - which Isolator version are you using? This bug was fixed in 7.0.4 which was released two days ago.

Disabled extensions - Test-Lint default mode is disabled and Auto-Runner is enabled. The fact it was loaded disabled is a bug and we're working on fixing it. Can you please post if after enabling Auto-Runner any error message is shown in the output pane?

Regards,
Elisha,
Typemock Support
answered by Elisha (12k points)
0 votes
For what I'm doing at the moment I want the tests in the same assembly as the code I'm testing.

I was using version 7.0.0. I uninstalled that and installed 7.0.4 and I can confirm that the issue with the 'ExtensionAttribute defined in multiple assemblies' warning is fixed.

After installing 7.0.4 there were still some issues though. The first couple of times I loaded Visual Studio it displayed the following errors in messageboxes one after the other.

The 'VSTS for Database Professionals Sql Server Data-tier Application' package did not load correctly.
The 'RadLangSvc.Package, RadLangSvc.VS, Version=10.0.0.0, Culture=neutral, PublicKeyTocken=89845dcd8080cc91' package did not load correctly.
The 'Language Package' did not load correctly.

After reloading Visual Studio a few times that went away. Then there was another issue where shortly after opening a solution or adding a new project to a solution Visual Studio reported that an exception had occured. I ran Visual Studio with logging enabled, the log contained the following:

<entry>
<record>367</record>
<time>2012/04/03 10:11:51.290</time>
<type>Error</type>
<source>Editor or Editor Extension</source>
<description>System.NullReferenceException: Object reference not set to an instance of an object.&#x000D;&#x000A; at Typemock.Common.Core.Logging.Aspects.ReportsGException.OnException(MethodExecutionArgs eventArgs)&#x000D;&#x000A; at Typemock.AutoRun.Adorners.MethodSummaryAdornmentFactory.TextViewCreated(IWpfTextView textView)&#x000D;&#x000A; at Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView.&lt;&gt;c__DisplayClassd.&lt;BindContentTypeSpecificAssets&gt;b__a()&#x000D;&#x000A; at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.CallExtensionPoint(Object errorSource, Action call)</description>
</entry>
<entry>
<record>368</record>
<time>2012/04/03 10:11:51.415</time>
<type>Error</type>
<source>Editor or Editor Extension</source>
<description>System.NullReferenceException: Object reference not set to an instance of an object.&#x000D;&#x000A; at Typemock.Common.Core.Logging.Aspects.ReportsGException.OnException(MethodExecutionArgs eventArgs)&#x000D;&#x000A; at Typemock.AutoRun.Adorners.MethodContextAdornmentFactory.TextViewCreated(IWpfTextView textView)&#x000D;&#x000A; at Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView.&lt;&gt;c__DisplayClassd.&lt;BindContentTypeSpecificAssets&gt;b__a()&#x000D;&#x000A; at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.CallExtensionPoint(Object errorSource, Action call)</description>
</entry>

Disabling TypeMock AutoRunner makes this exception go away. This is as before with 7.0.0 where you misunderstood my first post. I wasn't suggesting that the Lint and AutoRunner extensions being disabled was an issue, I was merely pointing out that I'd disabled AutoRunner myself to prevent this exception.
answered by John Doe (3.2k points)
0 votes
After more testing I find that these errors:

The 'VSTS for Database Professionals Sql Server Data-tier Application' package did not load correctly.
The 'RadLangSvc.Package, RadLangSvc.VS, Version=10.0.0.0, Culture=neutral, PublicKeyTocken=89845dcd8080cc91' package did not load correctly.
The 'Language Package' did not load correctly.

Occur if I enable the Lint extension, but do not occur if I disable it.
answered by John Doe (3.2k points)
0 votes
Hi,

Thanks for the detailed information. We're working on fixing the the bug that causes the exceptions appear in VS, I'll post on this thread soon regarding a fix.

Regards,
Elisha,
Typemock Support
answered by Elisha (12k points)
0 votes
Hi,

Are you using 32 or 64 bit OS?

Thanks,
Elisha,
Typemock Support
answered by Elisha (12k points)
0 votes
Hi

I'm having a very similar if not exact problem on the first-time load of a .cs source file into the VS2010 IDE; the Activity log has the following entries:-

<entry>
<record>370</record>
<time>2012/04/10 11:48:51.576</time>
<type>Error</type>
<source>Editor or Editor Extension</source>
<description>System.NullReferenceException: Object reference not set to an instance of an object.&#x000D;&#x000A; at Typemock.Common.Core.Logging.Aspects.ReportsGException.OnException(MethodExecutionArgs eventArgs)&#x000D;&#x000A; at Typemock.AutoRun.Adorners.MethodSummaryAdornmentFactory.TextViewCreated(IWpfTextView textView)&#x000D;&#x000A; at Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView.&lt;&gt;c__DisplayClassd.&lt;BindContentTypeSpecificAssets&gt;b__a()&#x000D;&#x000A; at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.CallExtensionPoint(Object errorSource, Action call)</description>
</entry>
<entry>
<record>371</record>
<time>2012/04/10 11:48:51.777</time>
<type>Error</type>
<source>Editor or Editor Extension</source>
<description>System.NullReferenceException: Object reference not set to an instance of an object.&#x000D;&#x000A; at Typemock.Common.Core.Logging.Aspects.ReportsGException.OnException(MethodExecutionArgs eventArgs)&#x000D;&#x000A; at Typemock.AutoRun.Adorners.MethodContextAdornmentFactory.TextViewCreated(IWpfTextView textView)&#x000D;&#x000A; at Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView.&lt;&gt;c__DisplayClassd.&lt;BindContentTypeSpecificAssets&gt;b__a()&#x000D;&#x000A; at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.CallExtensionPoint(Object errorSource, Action call)</description>
</entry>

Have you made any progress on a solution to the issue yet ?

Kind Regards
answered by mchatter (180 points)
0 votes
Hi,

We've created a patch that fixes this issue. It can be downloaded here, this fix will be released in the next version.

Please let me know if the issue is solved.

Regards,
Elisha,
Typemock Support
answered by Elisha (12k points)
0 votes
Thanks for the prompt response, Elisha.

The patch DOES resolve the issue!

Many Thanks
answered by mchatter (180 points)
...