locked
Unable to run UnitTests containing Fakes using the Windows System-Account RRS feed

  • Question

  • Given is a solution containing some UnitTests that use ms fakes. With a normal Windows-account, they can be run fine but as soon as I try to run them with the built-in Windows System-Account, execution fails trying to create the ShimsContext:

    Class Initialization method UnitTestIsolationError.Tests.UnitTest1.InitClass threw exception. Microsoft.QualityTools.Testing.Fakes.UnitTestIsolation.UnitTestIsolationException: Microsoft.QualityTools.Testing.Fakes.UnitTestIsolation.UnitTestIsolationException: Unexpected error returned by SetDetourProvider in profiler library 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\IntelliTrace\Microsoft.IntelliTrace.Profiler.dll'..
    Stack Trace:
       at Microsoft.QualityTools.Testing.Fakes.UnitTestIsolation.IntelliTraceInstrumentationProvider.Initialize()
       at Microsoft.QualityTools.Testing.Fakes.UnitTestIsolation.UnitTestIsolationRuntime.InitializeUnitTestIsolationInstrumentationProvider()
       at Microsoft.QualityTools.Testing.Fakes.Shims.ShimRuntime.CreateContext()
       at Microsoft.QualityTools.Testing.Fakes.ShimsContext.Create()
       at UnitTestIsolationError.Tests.UnitTest1.InitClass(TestContext myTestContext) in [...]\UnitTestIsolationError.Tests\UnitTest1.cs:line 15

    The issue can be reproduced in a completely new project/solution and it does not matter whether I run the test from within VS or the vstest.console.exe executable.

    • I am using the current version of VisualStudio 2017 (15.9.18)
    • I have neither a .runsettings nor a .testsettings file

    Is there some additional setup required to be able to run the tests using the System-Account?

    (Background is I want to run the tests on our build-server using Jenkins, which uses the System-Account per default).

    Monday, January 6, 2020 3:29 PM

All replies

  • Hi Björn-VCH,

    Welcome to MSDN forum.

    >> Is there some additional setup required to be able to run the tests using the System-Account?

    ## As far as I know, there is no additional setup required to be able to run the tests using the System-Account. But I’m not sure if you use something(maybe framework or tools/applications) that may need authority from System-Account?

    After researching more, I could not confirm if this is a potential issue in VS 2017 (15.9.18). Since you could completely reproduce it, I recommend you could report this (maybe) potential issue to the Visual Studio product team in Developer Community directly, from VS -> Help -> Send Feedback -> Report a Problem…

    Hope this could help you.

    Best Regards,

    Tianyu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.



    Tuesday, January 7, 2020 7:34 AM
  • Hi,

    thank you for your response. I will report the issue as you propose and update this thread as soon as I get any further information.

    Best Regards,
    Björn

    Wednesday, January 8, 2020 6:48 AM
  • Hi Björn-VCH,

    Thank you for your feedback.

    If you get any update, feel free to let us know.

    Best Regards,

    Tianyu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, January 9, 2020 1:13 AM