GoogleTestRunner icon indicating copy to clipboard operation
GoogleTestRunner copied to clipboard

Exception occurred while GoogleTestDiscoverer was loading tests. Process exited with code -1073741819

Open j4yk opened this issue 10 years ago • 8 comments

Hello,

when I built my solution the following appeared in the Tests output console:

------ Discover test started ------ GoogleTest: Does C:\Users(...)\xml3d-exporter-testdtest.exe match [Tt]est[s]{0,1}.exe: true An exception occurred while test discoverer 'GoogleTestDiscoverer' was loading tests. Exception: Process exited with code -1073741819 ========== Discover test finished: 0 found (0:00:00,393) ==========

The test explorer stays empty.

What might be the cause or what steps should be taken to investigate?

j4yk avatar Mar 07 '15 17:03 j4yk

This happens to me as well.

DanWatkins avatar Mar 16 '15 18:03 DanWatkins

This happens to me as well. I suspect the reason is that in Visual Studio under Test->Test Settings->Default architecture an incorrect architecture is selected. E.g. you build x64, but look for x86 tests in my case.

metallermartin avatar Aug 10 '15 11:08 metallermartin

Well, obviously the Test Settings are not the reason for this message. I again got it today with the correct setting

metallermartin avatar Aug 12 '15 09:08 metallermartin

Happens for me every time I try to load my project:

------ Discover test started ------ GoogleTest: Does C:\Users\myuser\myrepo\projects\windows\Debug\testrunner_tests.exe match [Tt]est[s]{0,1}.exe: true An exception occurred while test discoverer 'GoogleTestDiscoverer' was loading tests. Exception: Process exited with code -1 ========== Discover test finished: 0 found (0:01:59,1322548) ==========

The exception: An exception of type 'System.BadImageFormatException' occurred in mscorlib.dll but was not handled in user code

Additional information: Could not load file or assembly 'file:///C:\Users\myuser\myrepo\projects\windows\Debug\testrunner_tests.exe' or one of its dependencies. The module was expected to contain an assembly manifest.

If there is a handler for this exception, the program may be safely continued.

The call stack is here: http://pastebin.com/fwGircaK

$ file ./projects/windows/Debug/testrunner_tests.exe ./projects/windows/Debug/testrunner_tests.exe: PE32 executable (console) Intel 80386, for MS Windows

sveolon avatar Dec 03 '15 01:12 sveolon

Update: I took a look into the exception thrown. It says "Could not load file or assembly 'file:///C:\Users\myuser\myrepo\projects\windows\Debug\testrunner_tests.exe' or one of its dependencies. The module was expected to contain an assembly manifest." The HResult is 0x80131018.

So it is trying to load my test as if it was an assembly and fails. Looks like an obvious bug.

sveolon avatar Dec 04 '15 00:12 sveolon

It sounds like some of its dependencies are missing or the system expects you to have an assembly manifest file for the executable.

markusl avatar Dec 04 '15 08:12 markusl

I would like to continue digging into the issue, but as I have no experience in building VS Extensions, some info may be helpful. the issue happens when I'm running VS 2013 extension. However, it is not clear for me how to build and debug a 2013 version.

sveolon avatar Dec 04 '15 19:12 sveolon

Add compiler path to computer path

yuemw avatar Nov 15 '17 02:11 yuemw