-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Catastrophic failure: System.ComponentModel.Win32Exception (2): An error occurred trying to start process 'X:\app\publish\MyIntegrationTests.exe' with working directory 'X:\app\publish'. The system cannot find the file specified. #419
Comments
Oh, just saw this. This is definitely not supported. We require the app host to be present. |
This is all fine if it is intended and it seems like it is breaking change in upgrade from xunit 2.8.2 to v3. I am not sure if it should throw error though... Messaging is also inconsistent, as I ask for dll file Just to be clear, |
It's definitely a change from v2 to v3. In v2, test projects are class libraries; in v3, they're programs. The app host is necessary for us to launch the program.
It's gonna throw for sure. The only question is, should I catch and throw something more meaningful that might say something like "I couldn't find the executable, make sure you didn't disable the app host"? |
That I can't do anything about. That's VSTest saying "you tried to run something and nothing ran". That will continue to be the case even if the exception that gets thrown has a different message. |
…e when the app host is missing
Message updated in v3 This is the failure you will see now with
|
Thank you for explaining how things work now. New message should also help a lot! |
I found this issue when running integration tests in docker container (mcr.microsoft.com/dotnet/sdk:8.0-alpine) but it seems like it does not matter.
Let's start with publishing binaries with this command:
dotnet publish "MyIntegrationTests.csproj" -c Release -o /app/publish /p:UseAppHost=false
Note the UseAppHost=false (this will not produce executable file, only MyIntegrationTests.dll).
Next I want to run the tests. Here is the command with result:
Apparently runner did not found MyIntegrationTests.exe, but I specified that I want to execute tests from MyIntegrationTests.dll (exe is not created). I can workaround it by creating exe file (UseAppHost=true) but it is not recommended approach with containers.
Below you can find nuget versions that I use:
The text was updated successfully, but these errors were encountered: