none
Error while publishing test results to TFS using vstest console RRS feed

  • Question

  • HI 

    I am trying to run my tests using vstest_console.exe but it throws an error when I use TFS as a logger: 

    Error: Exception occurred while initializing logger with URI 'logger://Microsoft/TestPlatform/TfsLogger/v1'.  The logger will not be used.  Exception: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.TeamFoundation.TestPlatform.Client, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
    File name: 'Microsoft.TeamFoundation.TestPlatform.Client, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
       at Microsoft.VisualStudio.TestPlatform.Extensions.TfsLogger.TfsLogger.Initialize(TestLoggerEvents events, Dictionary`2 parameters)
       at Microsoft.VisualStudio.TestPlatform.Common.Logging.TestLoggerManager.AddLogger(Uri uri, Dictionary`2 parameters)

    === Pre-bind state information ===
    LOG: DisplayName = Microsoft.TeamFoundation.TestPlatform.Client, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
     (Fully-specified)
    LOG: Appbase = file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/TestAgent/Common7/IDE/CommonExtensions/Microsoft/TestWindow/
    LOG: Initial PrivatePath = NULL
    Calling assembly : Microsoft.VisualStudio.TestPlatform.Extensions.TfsLogger, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.
    ===
    LOG: This bind starts in default load context.
    LOG: Using application configuration file: C:\Program Files (x86)\Microsoft Visual Studio\2017\TestAgent\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe.Config
    LOG: Using host configuration file:
    LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
    LOG: Post-policy reference: Microsoft.TeamFoundation.TestPlatform.Client, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/TestAgent/Common7/IDE/CommonExtensions/Microsoft/TestWindow/Microsoft.TeamFoundation.TestPlatform.Client.DLL.
    LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/TestAgent/Common7/IDE/CommonExtensions/Microsoft/TestWindow/Microsoft.TeamFoundation.TestPlatform.Client/Microsoft.TeamFoundation.TestPlatform.Client.DLL.
    LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/TestAgent/Common7/IDE/CommonExtensions/Microsoft/TestWindow/Extensions/Microsoft.TeamFoundation.TestPlatform.Client.DLL.
    LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/TestAgent/Common7/IDE/CommonExtensions/Microsoft/TestWindow/Extensions/Microsoft.TeamFoundation.TestPlatform.Client/Microsoft.TeamFoundation.TestPlatform.Client.DLL.
    LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/TestAgent/Common7/IDE/CommonExtensions/Microsoft/TestWindow/Microsoft.TeamFoundation.TestPlatform.Client.EXE.
    LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/TestAgent/Common7/IDE/CommonExtensions/Microsoft/TestWindow/Microsoft.TeamFoundation.TestPlatform.Client/Microsoft.TeamFoundation.TestPlatform.Client.EXE.
    LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/TestAgent/Common7/IDE/CommonExtensions/Microsoft/TestWindow/Extensions/Microsoft.TeamFoundation.TestPlatform.Client.EXE.
    LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/TestAgent/Common7/IDE/CommonExtensions/Microsoft/TestWindow/Extensions/Microsoft.TeamFoundation.TestPlatform.Client/Microsoft.TeamFoundation.TestPlatform.Client.EXE.


    Wednesday, November 6, 2019 1:38 PM

All replies

  • Hi thakurAnunay,

    Welcome to MSDN forum.

    I checked the log file you shared above and notice that you are using Visual Studio 2017, could you tell us which version of VS 2017 are you using?

    If you are not using the latest version of VS 2017(or a version latter than 15.5), I suggest you update Visual Studio 2017 to the latest version and check if this issue could be solved. (Visual Studio Installer -> find VS 2017 -> Update)

    Also, I recommend you update “MSTest.TestFramework” and “MSTest.TestAdapter” NuGet package to the latest version by right-click your unit test project -> Manage NuGet Packages… -> Installed -> find these two packages and update them to the latest version then restart VS and check if it works.

    In addition, as the error message said “The system cannot find the file specified”. You might need to check if this file “Microsoft.TeamFoundation.TestPlatform.Client.DLL” or maybe “Microsoft.TeamFoundation.TestPlatform.Client.EXE” exists under this directory

     C:/Program Files (x86)/Microsoft Visual Studio/2017/TestAgent/Common7/IDE/CommonExtensions/Microsoft/TestWindow/Extensions  

    I consider this assembly maybe not be fully installed and the dll was missing. Try to download and install test agent manually and reboot your machine might solve this issue. (Install test agents)

    I also find a similar issue, maybe old and not very similar but helpful, this is the link.

    BTW, since our forum is discussing about the usage of tools and editors in Visual Studio, and TFS Forum has been moved to Developer Community Forum, if this issue persists, I suggest you could redirect to Developer Community tagged TFS and start a new thread there to seek for a more professional help.

    Hope all above 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.



    Thursday, November 7, 2019 5:35 AM
  • Hi 

    Thanks, i resolved this error by moving to VS2019. But in 2019, I am facing another issue

    

    Attached are the diagnostics logs. 

    TpTrace Information: 0 : 19112, 1, 2019/11/07, 00:01:06.995, 6477449140213, vstest.console.exe, AssemblyResolver.AddSearchDirectories: Adding more searchDirectories C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\Extensions\TestPlatform\Extensions,C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\Extensions\TestPlatform
    TpTrace Verbose: 0 : 19112, 1, 2019/11/07, 00:01:06.999, 6477449178754, vstest.console.exe, TestPluginCache: Discovered the extensions using extension path ''.
    TpTrace Verbose: 0 : 19112, 1, 2019/11/07, 00:01:06.999, 6477449180631, vstest.console.exe, TestPluginCache: Discoverers are ''.
    TpTrace Verbose: 0 : 19112, 1, 2019/11/07, 00:01:06.999, 6477449181855, vstest.console.exe, TestPluginCache: Executors are ''.
    TpTrace Verbose: 0 : 19112, 1, 2019/11/07, 00:01:06.999, 6477449182984, vstest.console.exe, TestPluginCache: Setting providers are ''.
    TpTrace Verbose: 0 : 19112, 1, 2019/11/07, 00:01:07.000, 6477449184480, vstest.console.exe, TestPluginCache: Loggers are 'logger://Microsoft/TestPlatform/Extensions/Blame/v1,logger://Microsoft/TestPlatform/TrxLogger/v1'.
    TpTrace Information: 0 : 19112, 1, 2019/11/07, 00:01:07.002, 6477449213160, vstest.console.exe, TestRequestManager.DiscoverTests: Discovery tests completed.
    TpTrace Error: 0 : 19112, 1, 2019/11/07, 00:01:07.029, 6477449482174, vstest.console.exe, ExecuteArgumentProcessor: failed to execute argument process: Microsoft.VisualStudio.TestPlatform.Common.Exceptions.InvalidLoggerException: Could not find a test logger with AssemblyQualifiedName, URI or FriendlyName 'TfsPublisher'.
       at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.TestLoggerManager.Initialize(String runSettings)
       at Microsoft.VisualStudio.TestPlatform.Client.TestPlatform.CreateDiscoveryRequest(IRequestData requestData, DiscoveryCriteria discoveryCriteria, TestPlatformOptions options)
       at Microsoft.VisualStudio.TestPlatform.CommandLine.TestPlatformHelpers.TestRequestManager.DiscoverTests(DiscoveryRequestPayload discoveryPayload, ITestDiscoveryEventsRegistrar discoveryEventsRegistrar, ProtocolConfig protocolConfig)
       at Microsoft.VisualStudio.TestPlatform.CommandLine.Processors.RunSpecificTestsArgumentExecutor.DiscoverTestsAndSelectSpecified(IEnumerable`1 sources)
       at Microsoft.VisualStudio.TestPlatform.CommandLine.Processors.RunSpecificTestsArgumentExecutor.Execute()
       at Microsoft.VisualStudio.TestPlatform.CommandLine.Executor.ExecuteArgumentProcessor(IArgumentProcessor processor, Int32& exitCode)
    TpTrace Verbose: 0 : 19112, 1, 2019/11/07, 00:01:07.031, 6477449501365, vstest.console.exe, Executor.Execute: Exiting with exit code of 1

    You can find the complete trace in the issue that I logged on git hub: 

    https://github.com/microsoft/vstest/issues/2244

    Thursday, November 7, 2019 5:58 AM
  • Hi thakurAnunay,

    Thank you for the feedback.

    Do you meet this issue when just open the command prompt or after entering some possible command lines?  And if you have entered some command lines, do you use command line like /logger:TfsPublisher?

    Since it is hard for us to check, I might recommend you this forum: Developer Community or Stack Overflow and supporters there could test and try to reproduce in their side then give you a satisfied reply. You could check this link.

    I’m really sorry for any inconvenience and thanks for your understanding.

    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, November 7, 2019 10:36 AM
  • I used the below command: 

    vstest.console.exe C:\BuildExecutables\\Tests.dll /Tests:TC_256816 /ResultsDirectory:C:\AutomationResults /logger:TfsPublisher;Collection=https://tfsb.xxx.com/tfs/xxx/Software;BuildName=1.1.0.0117.Internal;TeamProject=xxx;Platform="Any CPU";Flavor="Debug" /Diag:C:\MyLog.txt

    I have searched for all the possible answers. Then only I logged this question. 

    Thursday, November 7, 2019 12:20 PM
  • Hi thakurAnunay,

    Sorry for delay in reply.

    After checking your commands, I notice that you use /logger:TfsPublisher. And as far as I know TfsPublisher seems not support currently.

    This similar issue might guide a direction : TfsPublishing – CustomerLogger – Where and how is it supposed to publish info.

    I also noticed that singhsarab has mentioned about this, you could also refer to this.

    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.

    Monday, November 11, 2019 10:00 AM