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
Somebody already had the problem but their was with a different version and seemed to involve NCover.
I am using version v5.4.5.0. I have both the 32-bit and 64-bit versions installed on my box, because different launching programs seem to need different versions. When running from inside VisualStudio through ReSharper everything works fine, however when running from Nant I get:
[gallio] System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
[gallio] at System.ServiceModel.Description.ConfigLoader.CheckAccess(IConfigurationContextProviderInternal element)
[gallio] at System.ServiceModel.Description.ConfigLoader.LookupService(String serviceConfigurationName)
[gallio] at System.ServiceModel.ServiceHostBase.LoadConfigurationSectionInternal(ConfigLoader configLoader, ServiceDescription description, String configurationName)
[gallio] at System.ServiceModel.ServiceHostBase.ApplyConfiguration()
[gallio] at System.ServiceModel.ServiceHostBase.InitializeDescription(UriSchemeKeyedCollection baseAddresses)
[gallio] at System.ServiceModel.ServiceHost..ctor(Object singletonInstance, Uri[] baseAddresses)
[gallio] at ControllerTest.ControllerServiceTest.SetUp() in d:ControllerTestControllerServiceTest.cs:line 56
asked by ScottR (840 points)

19 Answers

0 votes
After removing the 5.2.3 version from the GAC, I now receive the following error:
Please send the following error to Typemock Support:
System.ComponentModel.Win32Exception: The system cannot find the file specified at:
...
TypeMock.AddIn.Infrastructure.ApplicationRunnerButtonBase.StartProgram

Pretty unhelpful error message as it doesn't specify which program it is unable to find.
answered by ScottR (840 points)
0 votes
Hi Scott,

What you see is a bug that is already fixed.
Can you please try the current version (6.0.1) and see if it solves the problem?
answered by ohad (35.4k points)
0 votes
Hello - I'm getting the same error when running TypeMock 6.0.1. The tests work fine when run via VS 2010 with TestDriven.net, but fail when trying to run the tests via TMockRunner on the command line. Any thoughts?

System.AccessViolationException : Attempted to read or write protected memory. This is often an indication that other
memory is corrupt.
at System.ServiceModel.Description.ConfigLoader.CheckAccess(IConfigurationContextProviderInternal element)
at System.ServiceModel.Description.ConfigLoader.LookupService(String serviceConfigurationName)
at System.ServiceModel.ServiceHostBase.LoadConfigurationSectionInternal(ConfigLoader configLoader, ServiceDescription
description, String configurationName)
at System.ServiceModel.ServiceHostBase.ApplyConfiguration()
at System.ServiceModel.ServiceHostBase.InitializeDescription(UriSchemeKeyedCollection baseAddresses)
at System.ServiceModel.ServiceHost.InitializeDescription(Type serviceType, UriSchemeKeyedCollection baseAddresses)
at System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[] baseAddresses)
answered by cboley (260 points)
0 votes
Hi,

Can you post here more details about the test and the environment?
Are you running with any other profiler enabled?
Are you running on x64 bit OS?
Are you using the auto deploy feature?
What is the tests framework? (nunit, mstest etc.)
answered by ohad (35.4k points)
0 votes
Windows 2008 R2 x64
Nunit is the testing framework
The error happens with or without linking TMockRunner to NCover. If I run one of the test that doesnt do mocking with just NUnit, the service is instantiated and the test passes. Here is a code snippet

[TestFixture]
public class ServiceTests
{
private ServiceHost myServiceHost;

[TestFixtureSetUp]
public void TestSetup()
{
myServiceHost = new ServiceHost(typeof(MyServiceHandler)); //Exception thrown here
myServiceHost.Open();
}
answered by cboley (260 points)
0 votes
Hi,
I tried to reproduce the problem with version 6.0.1 but everything runs just fine.
Can you send me a small solution that reproduces the problem?
Please send the solution to: support at typemock.com
answered by ohad (35.4k points)
0 votes
I sent a small project that reproduces the issue to the support email.
answered by cboley (260 points)
0 votes
Were you able to reproduce the problem with the test solution I sent?
answered by cboley (260 points)
0 votes
Hi Chris,

The solution does not reproduces the error on my machine so it's probably an environment issue.
I sent you a mail from the support mail box regarding this issue and a suggestion how we can continue with finding a solution for the problem.
answered by ohad (35.4k points)
...