none
Can't run the unit tests afters installing Visual Studio 2010 SP1

    Frage

  • We use Visual Studio 2010 on Windows 7 64 bit operating system. After installing the service pack 1 for Visual Studio 2010, when opening the Test View, we get the error:

    Error loading <UnitTestTest.dll>: Could not load file or assembly 'Microsoft.VisualStudio.Platform.AppDomainManager, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))

    where <UnitTestTest.dll> is a unit test assembly. This message is reported for some tests assemblies included in the solution, while other tests assemblies are properly loaded and the unit tests are visible in the Test View and can be executed.
    This error occurs on 4 development computers on which we have installed the service pack, plus a clean installation of Windows 7 and Visual Studio 2010 SP1. The message reported in the event viewer is:
    <br>
    The description for Event ID 0 from source VSTTExecution cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.
    If the event originated on another computer, the display information had to be saved with the event.
    The following information was included with the event: 
    (devenv.exe, PID 2876, Thread 1) Exception thrown when enumerating assembly: System.IO.FileLoadException: Could not load file or assembly 'Microsoft.VisualStudio.Platform.AppDomainManager, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))
    File name: 'Microsoft.VisualStudio.Platform.AppDomainManager, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
       at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
       at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
       at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks)
       at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
       at System.Activator.CreateInstance(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo, StackCrawlMark& stackMark)
       at System.Activator.CreateInstance(String assemblyName, String typeName)
       at System.AppDomain.CreateInstance(String assemblyName, String typeName)
       at System.AppDomain.CreateInstanceAndUnwrap(String assemblyName, String typeName)
       at System.AppDomain.CreateAppDomainManager()
       at System.AppDomain.Setup(Object arg)
       at System.AppDomain.nCreateDomain(String friendlyName, AppDomainSetup setup, Evidence providedSecurityInfo, Evidence creatorsSecurityInfo, IntPtr parentSecurityDescriptor)
       at System.AppDomainManager.CreateDomainHelper(String friendlyName, Evidence securityInfo, AppDomainSetup appDomainInfo)
       at System.AppDomainManager.CreateDomain(String friendlyName, Evidence securityInfo, AppDomainSetup appDomainInfo)
       at System.AppDomain.InternalCreateDomain(String friendlyName, Evidence securityInfo, AppDomainSetup info)
       at System.AppDomain.CreateDomain(String friendlyName, Evidence securityInfo, AppDomainSetup info)
       at Microsoft.VisualStudio.TestTools.Execution.ResolutionAppDomainHelper.CreateTestAppDomain(AppDomainSetup setupInfo)
       at Microsoft.VisualStudio.TestTools.Execution.ResolutionAppDomainHelper.CreateAppDomain()
       at Microsoft.VisualStudio.TestTools.TestTypes.Unit.AppDomainIsolatedHost.CreateEnumerator(String assemblyFileName, TestRunConfiguration testRunConfiguration, ObjectHandle& assemblyResolverWrapper)
       at Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestAttributeEnumerator.Read(ITestTypeExtensionClientSidesProvider provider, IWarningHandler warningHandler, String assemblyFileName, ProjectData projectData, TestRunConfiguration testRunConfiguration)
    === Pre-bind state information ===
    LOG: User = SergiuAsus\Sergiu
    LOG: DisplayName = Microsoft.VisualStudio.Platform.AppDomainManager, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
     (Fully-specified)
    LOG: Appbase = file:///C:/Projects/CommonReuse/Development/AllShare.Common.Business.Test.2/bin/Debug
    LOG: Initial PrivatePath = NULL
    Calling assembly : (Unknown).
    ===
    LOG: This bind starts in default load context.
    LOG: Found application configuration file (C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe.Config).
    ERR: Parse XML memory stream failed.
    the message resource is present but the message is not found in the string/message table
    <br>
    Uninstalling Visual Studio 2010 SP1 will fix the problem. Also on another computer we run Visual Studio 2010, Version 10.0.3.31118.1 SP1Rel (probably SP1 beta) and everything works as expected. Is it still possible to download somewhere this 10.0.3.31118.1 SP1Rel ?
    Any help will be greatly appreciated. 

     




    • Verschoben Alexander Sun Mittwoch, 22. Juni 2011 09:36 (From:Visual Studio Setup and Installation)
    Sonntag, 19. Juni 2011 11:52

Alle Antworten

  • Hi Sergiu,

     

    Thank you for your post.

     

    According to the description of your problem, you failed to open the Test View after you upgraded Service Pack 1.

     

    First, I recommend you check the folder “C:\Windows\Microsoft.NET\assembly\GAC_MSIL” to find a document named “Microsoft.VisualStudio.Platform.AppDomainManager”. If you have this folder, this file was probably corrupted. If this file does not exist, the possible cause of your problem is lack of this folder and corresponding files.

     

    Second, I also recommend you reinstall the Service Pack 1. Have you uninstalled Service Pack 1? If you have, Visual Studio 2010 must be reinstalled to restore certain components. Visual Studio 2010 Service Pack 1 upgrades some components of the Visual Studio 2010 original release version. If you uninstall Service Pack 1, some of these components are removed completely from the machine and not downgraded to their original versions. Moreover, Visual Studio 2010 must be reinstalled before SP1 can be installed again. After you have reinstalled Visual Studio 2010, download the ISO file from here: http://go.microsoft.com/fwlink/?LinkId=210710

    Check if there are any anti-virus or antispyware applications running. Make sure they are turned off during installation.

    Run the setup file with Administrator privileges: Right-click the installer > Run as administrator.

     

    If I have misunderstood anything, please feel free to let me know.

     

    Best Regards,


    Alexander Sun [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Dienstag, 21. Juni 2011 08:00
  • Hi Alexander,
    Thanks for the hints, but the solution can't be so simple. On one of the computers, I have a clean installation of Windows 7, Visual Studio 2100 + SP1. I have a single extension installed: ReSharper, but on other computers which don't have this extension, we have the same behavior. And I have all the problems described above. Also there are projects on which I can run the unit tests without any problem. 

    Just to be sure, I have done all the things you suggested:
    1. have checked that Microsoft.VisualStudio.Platform.AppDomainManager is in the right place;
    2. have re-installed Visual Studio and SP1, but this time I disabled my antivirus and have run the setup in Admin mode: right click the Run as Administrator. Also all the developers have Admin right on their computer
    After this the behavior is the same.

    The common things to all the computers having problems is: we run windows 7, 64 bit and the same projects, stored in TFS. The problem is probably somehow in how Microsoft.VisualStudio.Platform.AppDomainManager is used. Is it possible to detect somehow why it fails, when loaded? Can I get more log/trace info to understand what is happening with this assembly? 

    We use extensively PostSharp in our projects. Can this cause somehow this behaviour?

    I find this section from the event log significant:

    LOG: This bind starts in default load context.
    LOG: Found application configuration file (C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe.Config).
    ERR: Parse XML memory stream failed.

    only this error is too vague for me, because I don't know the internals of Visual Studio.


    Regards,

    Sergiu



    Dienstag, 21. Juni 2011 20:23
  • Hi Sergiu,

     

    Thank you for your reply.

     

    I am terribly sorry that your problem is about Unit Testing Features in Visual Studio 2010. I am not an expert on this field, so I will move your thread to Visual Studio Unit Testing forum. There are many experienced experts on your issue.

     

    Thanks.

     

    Best Regards,


    Alexander Sun [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Mittwoch, 22. Juni 2011 09:35
  • Hi Alexander,

    Thanks anyway! I am not getting any email notifications somehow. Do I have to start monitoring another URL for replies from Visual Studio Unit Testing forum?

    Have noticed in the meantime that it is the same URL :-)

    Sergiu

     


    Mittwoch, 22. Juni 2011 10:41
  • Hi Sergiu,

     

    No, you do not need to start monitoring another URL for replies from Visual Studio Unit Testing forum. In my opinion, the experts here will reply you soon.

     

    Thanks.

     

    Best Regards,


    Alexander Sun [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Donnerstag, 23. Juni 2011 06:31
  • Hi Sergiu,

    I am really sorry for replying so late.

    In case you still have this issue, can you please check whether you have an app.config file for your test project? If yes, can you please try removing it and see whether after that test works fine or not? Typically app.config file with the test project works fine but I have seen with another customer where he had a block in his app.config which was causing this failure.

    Regards

    Aseem Bansal

    • Als Antwort vorgeschlagen wongb Dienstag, 23. Juli 2013 23:07
    Mittwoch, 29. Februar 2012 12:26
  • We had exactly the same problem and it turned out to be the app.config problem. Removing it from the test project and it's all solved.
    Dienstag, 23. Juli 2013 23:08