Comments (14)
I have installed again the newest SDK and it worked so I cannot check for sure if the fix works but maybe @Jamaxack could test it.
from csharprepl.
Great! Thanks for raising the issue and confirming the fix.
from csharprepl.
Oof, thanks for reporting! Is this reproducible every time you start csharprepl?
I have the exact same Windows specifications that you have (down to the exact same point number), and I'm unable to reproduce it. If you press "Enter" as the first key, do you get a different stack trace?
EDIT: Could you please also share the output of dotnet --info
?
from csharprepl.
Thanks for the prompt response. Yes pressing the "Enter" as a first key also gives an error:
from csharprepl.
I just set up my computer's .NET SDK installation to match yours, and still can't reproduce the issue. From the stack traces, it's pretty clear that the Roslyn Workspace is failing to get built correctly, but it's odd that it's silently failing and we then get a NullReferenceException.
I'll set up some more logging to better understand the issue; it should be ready in a few days.
In the meantime, could you please verify if installing .NET 5 resolves the issue? CSharpRepl should run just fine on the .NET 6 previews, but it'd help to rule out the possibility of something unexpected in the previews.
from csharprepl.
@Jamaxack when you have a chance, could you please update to the prerelease version of CSharpRepl? The only thing different in the prerelease is that it now has a --trace
option that will help troubleshoot this.
You can update by running dotnet tool update -g csharprepl --version 0.3.4-rc
Then, please start csharprepl with the trace flag: csharprepl --trace
After you recreate the NullReferenceException, please share the csharprepl-tracelog-*.txt
file. It's written to the current working directory.
Thanks! I appreciate you helping out with this.
from csharprepl.
Thanks for the detailed steps. I updated to the 0.3.4-rc version and started with the trace flag.
Here is the logs for pressing 'enter' first and then restarting again and pressing 'c'.
2021-09-15T14:12:06 - Trace session starting
2021-09-15T14:12:06 - Starting background initialization
2021-09-15T14:12:07 - Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at CSharpRepl.Services.Roslyn.RoslynServices.IsTextCompleteStatementAsync(String text) in C:\Users\will.fuqua\source\repos\CSharpRepl\CSharpRepl.Services\Roslyn\RoslynServices.cs:line 143
at CSharpRepl.PrettyPromptConfig.PromptConfiguration.<>c__DisplayClass0_0.<<Configure>g__forceSoftEnterHandler|2>d.MoveNext() in C:\Users\will.fuqua\source\repos\CSharpRepl\CSharpRepl\PrettyPromptConfig\PromptConfiguration.cs:line 51
--- End of stack trace from previous location ---
at PrettyPrompt.Panes.CodePane.OnKeyDown(KeyPress key)
at PrettyPrompt.Prompt.InterpretKeyPress(KeyPress key, CodePane codePane, CompletionPane completionPane)
at PrettyPrompt.Prompt.ReadLineAsync(String prompt)
at CSharpRepl.ReadEvalPrintLoop.RunAsync(Configuration config) in C:\Users\will.fuqua\source\repos\CSharpRepl\CSharpRepl\ReadEvalPrintLoop.cs:line 41
at CSharpRepl.Program.Main(String[] args) in C:\Users\will.fuqua\source\repos\CSharpRepl\CSharpRepl\Program.cs:line 47
at CSharpRepl.Program.<Main>(String[] args)
2021-09-15T14:13:00 - Trace session starting
2021-09-15T14:13:00 - Starting background initialization
2021-09-15T14:13:01 - Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at CSharpRepl.Services.Roslyn.RoslynServices.CompleteAsync(String text, Int32 caret) in C:\Users\will.fuqua\source\repos\CSharpRepl\CSharpRepl.Services\Roslyn\RoslynServices.cs:line 114
at CSharpRepl.PrettyPromptConfig.PromptConfiguration.<>c__DisplayClass0_0.<<Configure>g__completionHandler|0>d.MoveNext() in C:\Users\will.fuqua\source\repos\CSharpRepl\CSharpRepl\PrettyPromptConfig\PromptConfiguration.cs:line 45
--- End of stack trace from previous location ---
at PrettyPrompt.Panes.CompletionPane.PrettyPrompt.Consoles.IKeyPressHandler.OnKeyUp(KeyPress key)
at PrettyPrompt.Prompt.InterpretKeyPress(KeyPress key, CodePane codePane, CompletionPane completionPane)
at PrettyPrompt.Prompt.ReadLineAsync(String prompt)
at CSharpRepl.ReadEvalPrintLoop.RunAsync(Configuration config) in C:\Users\will.fuqua\source\repos\CSharpRepl\CSharpRepl\ReadEvalPrintLoop.cs:line 41
at CSharpRepl.Program.Main(String[] args) in C:\Users\will.fuqua\source\repos\CSharpRepl\CSharpRepl\Program.cs:line 47
at CSharpRepl.Program.<Main>(String[] args)
```
Hope it will help.
from csharprepl.
There is an error: "One or more errors occurred. (Could not find Microsoft.NETCore.App 5.0.7 installation in C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref -- is it installed?)"
But in my machine it is installed in different path: Microsoft.NETCore.App 5.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
from csharprepl.
Thanks! That's useful. Just to make sure I fully understand the .NET installation setup, could you please share the output of the powershell command gci "C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref", "C:\Program Files\dotnet\shared\Microsoft.NETCore.App"
I think that your computer should have a "C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref" directory (I think is a standard disk layout in .NET), but if that's not the case then it's something I'll definitely need to handle in csharprepl. Thanks again.
from csharprepl.
from csharprepl.
Hello, I've just bumped into this project today and I have the same issue. It just exits after start. I get corresponding error in my case:
gci "C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref", "C:\Program Files\dotnet\shared\Microsoft.NETCore.App"
Directory: C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 26.12.2020 00:06 3.1.0
Directory: C:\Program Files\dotnet\shared\Microsoft.NETCore.App
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 20.03.2021 17:01 3.1.13
d---- 28.06.2021 23:05 3.1.15
d---- 20.03.2021 16:59 5.0.4
from csharprepl.
Thank you both @Jamaxack and @Drabenstein! It's because of the mismatch between those two folders. In both of your cases, the .NET 5 implementation assemblies are in "Microsoft.NETCore.App", but the .NET 5 reference assemblies are not in "Microsoft.NETCore.App.Ref".
While I work on a fix for csharprepl to handle this mismatch, I believe that both of you can solve it by installing the .NET SDK package from this link (the below screenshot shows the specific download). After installing this package, you should have .NET 5 subdirectories in both those directories.
from csharprepl.
I've just released csharprepl 0.3.4 that has a fix for this issue. I'm not sure if it handles all variations of .NET installations, but it should handle these. I'm assuming that the missing Microsoft.NETCore.App.Ref
installation is installed to ~/.nuget/packages/microsoft.netcore.app.ref
as mentioned in this design document.
Please try updating (dotnet tool update -g csharprepl
) and let me know! Thanks.
from csharprepl.
Yay, after updating to version 0.3.4 it works. Thanks for the quick fix.
from csharprepl.
Related Issues (20)
- Copy-pasting 🏴 causes crash
- DateTime.ToString formatting display error HOT 2
- CTRL+X sometimes crashes on Linux HOT 1
- Crash when editing line HOT 1
- Dependency problem while using Microsoft.Data.SqlClient
- Crash on PropertySubpatternCompletionProvider HOT 1
- (NU1101) Unable to find package Microsoft.SymbolStore. No packages exist with this id in source(s): nuget.org HOT 5
- Display type of exception when an exception is thrown.
- IntelliSense glitches on Fedora
- Windows 11 performance issues (general session slowdown over time) HOT 4
- should not accept the intelligen suggestion while hit space HOT 6
- How to use against a project with EF Core and Postgres?
- Don't require a trailing semicolon for a complete single statement other than an expression
- Static method overloads are suggested in instance method calls and vice versa
- Crash when typing `new Script`
- Include comments in generated IL listings HOT 1
- Define what are `<key-bindings>` under `csharprepl -h`
- Specify in `csharprepl -h` how multiple _Key Bindings_ options interact
- Namespaces HOT 1
- `System.Diagnostics.Debug.Assert` causes crash on assertion fail
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 csharprepl.