-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
JQ.Path returns the wrong value in LinqPad #17
Comments
Thank you for reporting the issue. Since my initial usage of this tool is within the context of a dotnet global tool (and since the included executable is provided as a runtime asset), I did not consider this LINQPad-specific usage. The way we include the binaries in the containing app is: <Content Include="$(MSBuildThisFileDirectory)../tools/*.*"
Link="lib/%(Filename)%(Extension)"
Visible="false"
CopyToOutputDirectory="PreserveNewest" />
</ItemGroup> It seems LINQPad isn't running the code as a console app and is setting up things differently. Note that out approach works even in unit tests, so there's something about this particular scenario. I don't have access to LINQPad 8 premium (required to install arbitrary nuget packages), so I can't work on this at the moment. If you feel generous and want to gift me that version (I do have premium of v5, but that one doesn't even allow me to install the package), I'd be very grateful and fix this for you: https://www.linqpad.net/Purchase.aspx. |
Instead of gifting you a license (not that you don't deserve it 😉), you can see a similar result in NetPad, a free clone:
(Here |
Hi @Arithmomaniac. I'll consider a PR for this. For the primary usage in multiple core scenarios (console apps, web apps, azure functions), the current approach is working great for me, so this is very low priority ATM. |
You can now back a specific issue to help prioritizing: back an issue 🙏 |
Describe the Bug
JQ.Path incorrectly assumes the jq.exe assembly will always be in
AppContext.BaseDirectory
, when that is not the case. This causesFileNotFoundException
s at runtime.Steps to Reproduce
Using LinqPad 8:
Expected Behavior
The path points to the actual location on disk (
C:\Users\arithmomaniac\.nuget\packages\devlooped.jq\1.7.1.1\tools\jq-windows-amd64.exe
)Exception with Stack Trace
Console output:
Version Info
dotnet 8
Devlooped.JQ 1.7.1.1
Additional Info
Seems like the right way to "include" the executable may be more like this: https://learn.microsoft.com/en-us/nuget/consume-packages/package-references-in-project-files#generatepathproperty
The text was updated successfully, but these errors were encountered: