Predefined type 'System.Object' is not defined or imported [dnxcore50]

5.6k Views Asked by At

Today, my project full of these errors. Same with "string", "int", etc. I am running the latest VS Code on Yosemite. Uninstalled and reinstalled DNVM. Deleted all packages from .dnx. I can run my program, but this is really bothering me.

3rd party edit

Using visual studio code 1.73.1 on with the error is this

Type "System.Object" is not defined or imported csharp(CS0518)

Steps to reproduce

  1. Open a folder with vs code
  2. Open a terminal and run dotnet new console --use-program-main
  3. Open Program.cs and see the result below

Screen of vs-code error

VS-Code_Error

3rd party VS Code version details

Version: 1.73.1 (system setup)
Commit: 6261075646f055b99068d3688932416f2346dd3b Date: 2022-11-09T04:27:29.066Z Electron: 19.0.17
Chromium: 102.0.5005.167 Node.js: 16.14.2
V8: 10.2.154.15-electron.0

OS: Windows_NT x64 10.0.19042
Sandboxed: No

In my version

0

There are 0 best solutions below