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
We have CruiseControl set up to run tests and deploy our solution. The test are run without problem under admin priviliges, but we have special account for cruise control (not admin) and tests are failed under this account.

Here is the code:

        private void MyTestGenerinc<Service>() where Service : IService, new()
        {
            Mock serviceMock = MockManager.MockAll(typeof(Service));
            ....
        }


It failes inside MockAll method.

The exception mesasage is:

Unhandled Exception: System.Security.SecurityException: Requested registry access is not allowed.
at System.ThrowHelper.ThrowSecurityException(ExceptionResource resource)
at Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable)
at aj.a(Boolean A_0)
at aj.e()
at TypeMock.MockManager.c(Type A_0)
at TypeMock.MockManager.MockAll(Type type, Constructor mockConstructors)

Please, note that tests works fine if we give admin rights to cruise control user.
asked by ezaritov (2.8k points)

3 Answers

0 votes
What version are you using?
answered by scott (32k points)
0 votes
TypeMock.NET 3.0.3.0

The failure occures only under cruise control windows account (it uses nunit-console).

We manage to fix some errors by giving access to several registry entries (we find some using Regmon). Nevetheless, we still have problems.
answered by ezaritov (2.8k points)
0 votes
Please try version 3.1.1,
we have relaxed the security needed in this version (although linking still requires high security)
answered by scott (32k points)
...