Skip to content
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

#r doesn't work as expected with local libraries #609

Closed
mehmetakbulut opened this issue Nov 8, 2019 · 8 comments
Labels

Comments

@mehmetakbulut
Copy link

@mehmetakbulut mehmetakbulut commented Nov 8, 2019

Describe the bug

This issue has two parts, not sure if they are related:

  1. Attempting to load a locally available library using #r with an absolute path fails partially. An error will be printed as if the #r command failed but namespace is available and types are usable if included with a using statement. Regardless, autocompletion of anything involving this local library doesn't work except when writing the using statement.
  2. Attempting to load a locally available library using #r with a relative path fails completely. It will print out the standard file not found error. I'm not certain if this is intended to work so a clarification would be great. Without using an absolute path, certain (all?) system packaged libraries seem to be loadable just fine which makes me think there is some special handling concerning those.

Both issues are present in Jupyter Notebook, Lab and Console. Tried with various dlls that were either originally downloaded with nuget or built locally.

Did this error occur while using dotnet try or online?

  • dotnet-try (jupyter)
  • online

What kind of error was it?

  • User Interface (UI): For example the output never displayed
  • Service Error: For example "The service is temporarily unavailable. We are working on it"
  • Other: Potential issue with .NET C# Kernel for Jupyter

Screenshots

No screenshots but:

Windows

#r "C:/Users/Mehmet/.nuget/packages/newtonsoft.json/12.0.2/lib/netstandard2.0/Newtonsoft.Json.dll"

Invalid: Command: #r C:/Users/Mehmet/.nuget/packages/newtonsoft.json/12.0.2/lib/netstandard2.0/Newtonsoft.Json.dll

Linux

#r "/home/mehmet/.nuget/packages/newtonsoft.json/12.0.2/lib/netstandard2.0/Newtonsoft.Json.dll"

Invalid: Command: #r /home/mehmet/.nuget/packages/newtonsoft.json/12.0.2/lib/netstandard2.0/Newtonsoft.Json.dll

Please complete the following:

  • OS
    • Windows 10
    • macOS
    • Linux (Ubuntu 18.04)
    • iOS
    • Android
  • Browser
    • Chrome
    • Edge
    • Safari
@jonsequitur

This comment has been minimized.

Copy link
Collaborator

@jonsequitur jonsequitur commented Nov 8, 2019

This should be fixed by #600.

@mehmetakbulut

This comment has been minimized.

Copy link
Author

@mehmetakbulut mehmetakbulut commented Nov 8, 2019

Thank you @jonsequitur. Do you have any clue which release / when the contents of that PR will be available on a feed?

@jonsequitur

This comment has been minimized.

Copy link
Collaborator

@jonsequitur jonsequitur commented Nov 8, 2019

Every PR that merges produces a new package in this feed: https://dotnet.myget.org/F/dotnet-try/api/v3/index.json. You can grab the latest by running this in your console:

> dotnet tool update -g dotnet-try --add-source https://dotnet.myget.org/F/dotnet-try/api/v3/index.json
@jonsequitur jonsequitur closed this Nov 8, 2019
@jonsequitur

This comment has been minimized.

Copy link
Collaborator

@jonsequitur jonsequitur commented Nov 8, 2019

The fix for this is now available in MyGet feed. Please give it a try and let us know if you see any issues.

@mehmetakbulut

This comment has been minimized.

Copy link
Author

@mehmetakbulut mehmetakbulut commented Nov 10, 2019

It looks like the error is no longer displayed with absolute paths but behavior is same as before (i.e. autocompletion doesn't work for types from the imported library)

Relative paths still don't seem to be working. (tried referencing from both jupyter's workspace root and kernel's working directory)

@jonsequitur

This comment has been minimized.

Copy link
Collaborator

@jonsequitur jonsequitur commented Nov 11, 2019

Autocomplete support is not complete so this isn't indicative of a loading failure. Does code compile successfully against the imported library?

@mehmetakbulut

This comment has been minimized.

Copy link
Author

@mehmetakbulut mehmetakbulut commented Nov 11, 2019

Gotcha. Yes, code compiles great when importing libraries with absolute paths.

How about relative paths? I see them working fine in csi but with .NET Kernel and Jupyter, it complains that the path is wrong. (same on both Win10 and Ubuntu 18.04)

@jonsequitur

This comment has been minimized.

Copy link
Collaborator

@jonsequitur jonsequitur commented Nov 11, 2019

I don't see why a relative path shouldn't work but maybe the working directory is wrong or unclear. I'll give it a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.