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
Pact core not found in .Net Core XUnit test #144
Comments
Hmm. Yeah that is a tricky one, it definitely did work, I just can't remember if it was in a netcore1.0 scenario. A PR would be amazing! I think ideally we want find the test assembly location and probe there. Potentially we could fallback to AppContext.BaseDirectory. |
I had the same issue. I created a fork and changed the PactCoreHost.cs. The following approach worked for me: DennisJantos@e0f6d6b Is there any update on this issue? |
I have to admit, I started looking at it, but stalled, struggling to get the unit tests working under Linux/.Net Core. |
I'm pretty sure this is fixed in later versions of .Net Core. Feel free to reopen if not 👍 |
I'm trying to use PactNet in a .Net Core XUnit test, when running "dotnet xunit" I get:
I do have the PactNet.Linux.x64 package added.
I believe this is because Contants.cs uses AppContext.BaseDirectory, which is then used in PactCoreHost.cs as the expected root of the pack core path.
However, when running under XUnit in .Net core, the AppContext.BaseDirectory folder is not the same as the build directory:
You can reproduce this using the attached project: test.tar.gz
There was a similar issue for XUnit and ASP.Net MVC
I can think of a couple of fixes:
I'm happy to write something and make a pull request if you express a preference...
The text was updated successfully, but these errors were encountered: