locked
Error occurs in test run deployment while getting satellite assemblies: System.ArgumentOutOfRangeException RRS feed

  • Question

  • An error uccurs in test run with vstest.console
    Warning: Test Run deployment issue: an error occurred while getting satellite assemblies for deployment item '...': System.ArgumentOutOfRangeException: startIndex cannot be larger than length of string.

    The error occurs for assemblies in the following situation:
    - given an assembly with name Component.Unit.dll in directory D:\TFS\myProject\bin
    - another assembly named Component.Unit.Resources.dll exists in directory D:\TFS\myProject\bin
    - assembly Component.Unit.Resources.dll is NOT referenced in Component.Unit
    - When executing unit tests for Component.Unit.dll the above warning occurs.

    The testrunner is trying to find satellite assemblies for Component.Unit.dll. It finds the assembly D:\TFS\myProject\bin\Component.Unit.Resources.dll. It is trying to determine which culture subdirectory the assembly was found in. It takes the path "D:\TFS\myProject\bin" and tries to extract the culture subdirectory. There the "System.ArgumentOutOfRangeException: startIndex cannot be larger than length of string" exception is thrown.

    We want to get rid of these Warnings, as there occur quite a lot of them in our nightbuild.

    How can we avoid this error without renaming the Component.Unit.Resources.dll assembly?

    (The testrunner should not look for satellite assemblies in D:\TFS\myProject\bin. It should only take subdirectories into account => bug in testrunner?)



    Monday, April 13, 2015 11:52 AM

All replies

  • Hi Florian,

    Thank you for posting in MSDN forum.

    Based on your issue, could you please tell me how you deployment the assembly for unit test?

    Where did you run this unit test with deployment assembly and then get the above error message, is it in the VS IDE or TFS?

    If you get the above error message when you are running the unit test in Test Explorer from VS IDE, I suggest you could refer the following MSDN document to check if you deploy the assembly correctly.

    https://msdn.microsoft.com/en-us/library/ms182475.aspx?f=255&MSPPError=-2147217396

    Or you could refer the above document to re-deployment your assembly and then check if you could run this unit test successfully.

    If possible, I suggest you could told me more detailed message about your issue.

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, April 14, 2015 6:15 AM
  • Hi Tina,
    thank you for your reply.

    The build output folder of our project is D:\TFS\myProject\bin. The project is build in x64 Debug. From there I am running the tests with the vstest.console.exe in a command shell: "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console" /inIsolation /platform:x64  Component.Unit_uTest.dll

    A deployment folder is automatically created by vstest.console.exe in the D:\TFS\myProject\bin\TestResults folder. The deployment is done by vstest.console.

    The same warnings occur in the nightbuild on TFS environment. Test runner is the Visual Studio Test Runner, Target Platform is X64.

    Best Regards
    Florian

    Tuesday, April 14, 2015 6:49 AM
  • Hi Florian,

    Glad to receive your reply.

    According to your description, as you said that when you run unit test in X64 debug using vstest.console.exe in command line and the get the error message.

    I tried to create a unit test named Component.Unit and then change this platform as x64 debug, then I run this unit test, it failed in the test explorer from VS IDE. But I run it by the X86 or Any CPU, it runs successfully.

    So I suggest you could try to run your unit test in X86 or Any CPU using vstest.console.exe in command line and then check if you get same error message.

    If the above suggestion still could not help you, since we could not reproduce your issue. So if possible, I suggest you could share me your sample so that we will further help you solve this issue.

    You could upload the sample to OneDrive and then copy link here.

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, April 15, 2015 5:37 AM
  • Hi Florian,

    Would you mind letting us know the latest inforamtion about this issue?

    >>Warning: Test Run deployment issue: an error occurred while getting satellite assemblies for deployment item '...': System.ArgumentOutOfRangeException: startIndex cannot be larger than length of string.

    As you said that this test project has this issue when you run it with TFS-Build and VS vstest.console, How about running it with VS IDE?

    Based on the error "System.ArgumentOutOfRangeException", I doubt that the real issue is related to the null reference.

    Reference:

    https://msdn.microsoft.com/en-us/library/vstudio/wkd6khbd(v=vs.100).aspx

    Best Regards,

    Jack


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, April 16, 2015 10:06 AM