Comments (6)
I am afraid this is due to a difference between C# and F# #r syntax.
In C# #r is followed by a directive string which doesn't require escaping on the \ characters.
In F# #r is followed by a string which requires \ to be escaped I'e \.
However, that is somewhat annoying so instead often we use @ strings, which are similar to directive strings in C#.
So your code would become:
#r @"C:\Users\tomip\.nuget\packages\newtonsoft.json\12.0.2\lib\netstandard2.0\Newtonsoft.Json.dll"
And that should work fine.
Kevin
from interactive.
The change you described, once implemented, will it also impact to #load or #r only? What about csx files that are #load'ed to Jupyter and that contain #r directives should those #r directives be with @ or without?
from interactive.
I'm not certain @
is the issue here. (which actually makes the import fail under C#)
I see the following using the C# kernel:
#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
However ironically, it does load the DLL, you can refer to the namespace(s) and use included types. One big caveat: completion only works when typing using
but not for anything else that involves types from the DLL.
.NET Core SDK: 3.0.100
dotnet-try: 1.0.19555.1+ee3dc325df2fb737bc0af13bbdd9927a9360e59a
from interactive.
fsi and csi are different scripting languages and there exists prior art, that we will require to be compatible with, as to what is valid in #r and #load arguments.
In F# the provided line can be:
1:
#r C:\\Users\\tomip\\.nuget\\packages\\newtonsoft.json\\12.0.2\\lib\\netstandard2.0\\Newtonsoft.Json.dll"
2:
#r @"C:\Users\tomip\.nuget\packages\newtonsoft.json\12.0.2\lib\netstandard2.0\Newtonsoft.Json.dll"
3:
#r """C:\Users\tomip\.nuget\packages\newtonsoft.json\12.0.2\lib\netstandard2.0\Newtonsoft.Json.dll"""
4:
C:/Users/tomip/.nuget/packages/newtonsoft.json/12.0.2/lib/netstandard2.0/Newtonsoft.Json.
The invalid command in your C# example is a bug in the C# #r command handler certainly we expect #r with valid linux path chars to work. Please raise a separate issue for that to avoid confusion.
In F# #r and #load strings both will require escaped strings or @"" that conform to the existing fsi script language.
C# will undoubtedly continue to use directive strings, to conform with the existing csi scripting language.
from interactive.
@KevinRansom That makes sense. Will create a separate issue.
from interactive.
from interactive.
Related Issues (20)
- Add support for DuckDB HOT 3
- More than one Mermaid Diagram does not render properly on Export to HTML or PDF
- variable sharing on notebook created types HOT 4
- June 2024 rough plan of work HOT 2
- Magic command API redesign HOT 8
- Polyglot Notebook: [DevExE2E] The cell kept in running status and can't be stopped in the newly created .dib/ipynb file.
- Polyglot Notebook: [DevExE2E] When saving the newly created .dib/ipynb file, the cell execution results will be disappeared and these files still in unsaved status.
- Is a kernel per user split a good idea ? HOT 2
- Can I specify the target platform? HOT 1
- July rough plan of work (2024)
- Polyglot alway pop up error messages: `The .NET SDK version is not sufficient. The required version is 8.0.`
- ImageGenerator in Microsoft.DotNet.Interactive.AI encounters Semantic Kernel failures. HOT 2
- Disabling editor.semanticHighlighting disabled ALL syntax highlighting for C# in polyglot
- Extension setting Default Notebook Language doesn't work HOT 1
- Jaws is not announcing table cells when user is using universal table keys Ctrl + Alt + Right/left arrow keys and also with T key JAWS focus is not landing on table: A11y_Testing, Interactive and ARM tools_Table_Screen Reader. HOT 2
- No single pointer provided to drag the "columns headers" to the required position in the "Polyglot Notebook" grid table: A11y_Testing, Interactive and ARM tools_Table_Screen Reader. HOT 1
- [Codespaces/JavaScript] localhost is not accessible from a polyglot notebook within GitHub Codespaces environment HOT 2
- Language metadata is not updated in .NET notebook HOT 5
- issue with attached debugging of a C# dll from F# polyglot HOT 5
- new magic command parser fails if quoted parameter value doesn't contain valid JSON
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from interactive.