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

System.Array Not Found Error #1006

Closed
samueleaton opened this issue Aug 31, 2022 · 11 comments
Closed

System.Array Not Found Error #1006

samueleaton opened this issue Aug 31, 2022 · 11 comments

Comments

@samueleaton
Copy link

samueleaton commented Aug 31, 2022

I'm running with fsautocomplete --background-service-enabled --verbose and the logs show:

fsautocomplete: [13:55:47.620 INF] [Compiler] Finished Service_ParseAndCheckFileInProject: /Users/same/dev/REDACTED.fs_ProjectId=/Users/same/dev/REDACTED.fs.fsproj-Failed_Aborted

fsautocomplete: [13:55:47.620 INF] [Checker] ParseAndCheckFileInProject - "/Users/same/dev/REDACTED.fs" completed with errors: [{"Range": {"File": "unknown", "Start": {"Line": 0, "Column": 0, "$type": "Pos"}, "End": {"Line": 0, "Column": 0, "$type": "Pos"}, "$type": "Rng"}, "Severity": {"$type": "Error"}, "Message": "internal error: One or more errors occurred. (Assembly: The system type 'System.Array' was required but no referenced system DLL contained this type, full path: System.Array)", "Subcategory": "parameter", "ErrorNumber": 193, "ErrorNumberPrefix": "FS", "ErrorNumberText": "FS0193", "Start": {"Line": 0, "Column": 0, "$type": "Pos"}, "End": {"Line": 0, "Column": 0, "$type": "Pos"}, "StartLine": 0, "EndLine": 0, "StartColumn": 0, "EndColumn": 0, "FileName": "unknown", "$type": "FSharpDiagnostic"}]

fsautocomplete: [13:55:47.620 INF] [LSP] PositionHandler - Cached typecheck results not yet available for /Users/same/dev/REDACTED.fs

fsautocomplete: [13:55:47.640 INF] [Compiler] Finished Service_ParseAndCheckFileInProject: /Users/same/dev/REDACTED.fs_ProjectId=/Users/same/dev/REDACTED.fs.fsproj-Failed_Aborted

The main error being internal error: One or more errors occurred. (Assembly: The system type 'System.Array' was required but no referenced system DLL contained this type, full path: System.Array)

I'm on an Arm Mac, and running dotnet 7.0.100-preview.7.22377.5.

When I run the Troubleshoot Server command in Sublime Text, the server doesn't respond with any output:

Troubleshooting: fsautocomplete

Version

  • LSP: 1.18.0
  • Sublime Text: 4126

Server Test Run

  • exit code: 0
  • output

Server Configuration

  • command
[
  "fsautocomplete", 
  "--background-service-enabled", 
  "--verbose"
]
  • shell command
fsautocomplete --background-service-enabled --verbose
  • selector
source.fsharp
@baronfel
Copy link
Contributor

We don't currently support running on 6.0.400 or the 7.0.100 previews, though there is a WIP PR [#999] that tracks adding and releasing that support.

@samueleaton
Copy link
Author

@baronfel I downgraded to 6.0.400 and still getting the same error. Although I think the version in my project shouldn't matter, since the fsautocomplete tool has it's own version in the tool bundle, no?

@baronfel
Copy link
Contributor

I would expect the same error in certain situations on 6.0.400 - as I said we don't support it fully at the moment. The FSAC tool does not bundle the SDK in any way - in fact the opposite, it relies on the version of the SDK you point it at implicitly via your global.json.

@samueleaton
Copy link
Author

Oh sorry i misread as you support 6.0.400 not the 7.0.100 preview. My mistake. Downgraded my project global.json to 6.0.302 and it works now.

@gbtb
Copy link
Contributor

gbtb commented Dec 17, 2022

Hello, @baronfel .
Is version 0.58.2 supposed to be working with 7.0.100 sdk ? Because in my case the same error still happening.

@vain0x
Copy link
Contributor

vain0x commented Jan 2, 2023

I installed .NET SDK 6.0.302 (dotnet-sdk-6.0=6.0.302-1 from apt) but this error still happens.

Due to this error, some of following requests (semanticTokens) fail don't work, unable to retrieve check results.

This is log from ionide-vscode-fsharp:

[14:02:42.456 INF] [Checker] ParseAndCheckFileInProject - "/home/owner/repo/fs-playground/Program.fs" completed with errors: [{"Range": {"File": "unknown", "Start": {"Line": 0, "Column": 0, "$type": "Pos"}, "End": {"Line": 0, "Column": 0, "$type": "Pos"}, "$type": "Rng"}, "Severity": {"$type": "Error"}, "Message": "internal error: One or more errors occurred. (Assembly: The system type 'System.Array' was required but no referenced system DLL contained this type, full path: System.Array)", "Subcategory": "parameter", "ErrorNumber": 193, "ErrorNumberPrefix": "FS", "ErrorNumberText": "FS0193", "Start": {"Line": 0, "Column": 0, "$type": "Pos"}, "End": {"Line": 0, "Column": 0, "$type": "Pos"}, "StartLine": 0, "EndLine": 0, "StartColumn": 0, "EndColumn": 0, "FileName": "unknown", "$type": "FSharpDiagnostic"}]

Machine Info
  • Operating system: Linux
  • Arch: x64
  • VSCode: 1.74.2
  • UI Kind: Desktop
  • Ionide: 7.4.0
  • Runtime: netcore
  • Dotnet version: 6.0.302

@kaashyapan
Copy link
Contributor

kaashyapan commented Jan 10, 2023

The crash is coming from https://github.com/fsharp/FsAutoComplete/blob/d74332594a29b8bae412032a2e75a4818f7a633f/src/FsAutoComplete/LspServers/AdaptiveFSharpLspServer.fs#L810

The solution seems to be to manually provide additional arguments to fsac at startup. --state-directory $PWD/.ionide.
The directory is used to store the cache.

This works for me on linux with neovim-lsp client.

@baronfel
Copy link
Contributor

Interesting - we should default to CWD for that parameter (see https://github.com/fsharp/FsAutoComplete/blob/main/src/FsAutoComplete/Parser.fs#L91-L97), does something about that cause a problem? Should we change the default for that 'state directory' to something other than the current directory?

@TheAngryByrd
Copy link
Member

TheAngryByrd commented Jan 10, 2023

The crash is coming from

https://github.com/fsharp/FsAutoComplete/blob/d74332594a29b8bae412032a2e75a4818f7a633f/src/FsAutoComplete/LspServers/AdaptiveFSharpLspServer.fs#L810

The solution seems to be to manually provide additional arguments to fsac at startup. --state-directory $PWD/.ionide. The directory is used to store the cache.

This works for me on linux with neovim-lsp client.

Adaptive doesn't use the state-directory so setting that wouldn't change its behavior.


Anything related to System.Array not being found is most likely an upstream issue with proj-info.

@ShalokShalom
Copy link
Contributor

I might get the same error. This happens upon trying to launch it within Helix.

Full log, see line 84

The system type 'System.Array' was required but no referenced system DLL contained this type, full path: System.Array

Thanks a lot

dotnet --version
7.0.102

fsautocomplete --version
0.58.4+379321556d666825ef0ba1f30e16ddc293abb512

@TheAngryByrd
Copy link
Member

Closing this as I haven't seen this report in a while. If you're still experiencing this after a dotnet restore -c Debug then enable a binlog for your solution
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants