-
Notifications
You must be signed in to change notification settings - Fork 789
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
dotnet xunit fails to load dependent DLLs, but dotnet test succeeds #1509
Comments
Please try with the latest 2.4 beta 1 build from our CI builds on MyGet, as this is likely already fixed (and planned for 2.3.1). Let me know if you're still having issues even with the latest build. |
Thanks @bradwilson, I'll give that a try - might be related to #1490 |
@bradwilson I'm seeing the same FileNotFoundException here https://github.com/jp7677/hellocoreclr/tree/master/test/HelloCoreClrApp.Test Please note though that even with 2.4.0-beta I'm still seeing test failures that are successful with dotnet test and the latest 2.3 beta. The exception looks like:
I wonder if this is related to that commit: e79a5ab |
I have similar problem. Tests passes when I run them from visual studio but fails when run by xunit.console. I import dll using DllImport. Tests fails with message: System.BadImageFormatException : An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B) Cant solve the problem. And second thing, when I use FreeLibrary, tests stops: `[DllImport("kernel32", SetLastError = true)] |
This usually means that the image you're trying to load is wrong for some reason: wrong bitness (i.e., 32-bit instead of 64-bit) or the wrong CPU (i.e., ARM instead of Intel). |
Open a new issue with a repro project, please. |
It's the same if you try to read a file (e.g. NLog config) from the current directory. It looks like
...because my code just tries to access |
From looking at the source code, there's a few places where it does: #if NET452
Directory.SetCurrentDirectory(Path.GetDirectoryName(TestAssembly.Assembly.AssemblyPath));
#endif Using this, I changed my project to run as |
Original issue is fixed. If there are still outstanding things, please open new issues. |
Raised #1579 |
Currently in the process of debugging akkadotnet/akka.net#3150
When I work on the following .CSPROJ within the solution: https://github.com/akkadotnet/akka.net/tree/dev/src/contrib/persistence/Akka.Persistence.Sqlite.Tests
dotnet xunit
is able to execute the unit tests just fine for the .NET 4.5.2 target, but when it comes time to execute the .NET Core 1.1 target the runner is unable to find thesqlite.dll
dependency, which is referenced in a child project's NuGet dependencies.This issue occurred rather suddenly this week after we upgraded to 2.3.0. The part that confuses me is that if we run the same specifications on .NET Core using
dotnet test
instead ofdotnet xunit
, everything runs fine and the tests all pass.Any idea what's occurring here?
The text was updated successfully, but these errors were encountered: