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

GalliumOS Omnisharp.path error #848

Closed
Neoakb opened this issue Oct 28, 2016 · 24 comments
Closed

GalliumOS Omnisharp.path error #848

Neoakb opened this issue Oct 28, 2016 · 24 comments

Comments

@Neoakb
Copy link

Neoakb commented Oct 28, 2016

Environment data

dotnet --info output:
.NET Command Line Tools (1.0.0-preview2-003131)

Product Information:
Version: 1.0.0-preview2-003131
Commit SHA-1 hash: 635cf40e58

Runtime Environment:
OS Name: galliumos
OS Version: 2.0
OS Platform: Linux
RID: galliumos.2.0-x64

VS Code version: latest
C# Extension version: latest

Steps to reproduce

Start VC

Expected behavior

Actual behavior

this came first:
[ERROR] Could not locate an OmniSharp server that supports your Linux distribution.

OmniSharp provides a richer C# editing experience, with features like IntelliSense and Find All References.
It is recommend that you download the version of OmniSharp that runs on Mono using the following steps:
1. If it's not already installed, download and install Mono (https://www.mono-project.com)
2. Download and untar the latest OmniSharp Mono release from https://github.com/OmniSharp/omnisharp-roslyn/releases/
3. In Visual Studio Code, select Preferences->User Settings to open settings.json.
4. In settings.json, add a new setting: "omnisharp.path": "/path/to/omnisharp/OmniSharp.exe"
5. In settings.json, add a new setting: "omnisharp.useMono": true
6. Restart Visual Studio Code.

So I followed the instructions. my setting.json:
// Place your settings in this file to overwrite the default settings
{
"omnisharp.path": "/home/chrx/Omnisharp/Omnisharp.exe",
"omnisharp.useMono": true
}

I get this error on startup:

Invalid value specified for "omnisharp.path" ('/home/chrx/Omnisharp/Omnisharp.exe).

@Neoakb
Copy link
Author

Neoakb commented Oct 28, 2016

I changed Omnisharp.exe to OmniSharp.exe in the path, that still didn't fix it.

@DustinCampbell
Copy link
Member

The entire path is case-sensitive. Also, what version of Mono do you have installed?

@Neoakb
Copy link
Author

Neoakb commented Nov 1, 2016

http://imgur.com/pDs98FGl.png

There's a screenshot with mono -v, VC settings.json, and the file manager open to the Omnisharp install. I did fix the syntax error that's present in the json

Mono is working fine. I can run the hello test just fine.

I get this error when I run a simple .cs file though rightclick -> Run Code
(using https://code.visualstudio.com/docs/runtimes/dotnet to create a new dotnet project)

[Running] scriptcs "/home/chrx/Documents/TestingOmni/Program.cs"
/bin/sh: 1: scriptcs: not found

[Done] exited with code=127 in 0.031 seconds


While testing different ideas, I found by renaming Omnisharp (the one highlighted in the file manager) to Omnisharp.exe I now get this on startup:

Starting OmniSharp server at 11/1/2016, 12:27:50 AM
Target: /home/chrx/Documents/TestingOmni

OmniSharp server started wth Mono
Path: /home/chrx/Omnisharp/OmniSharp.exe
PID: 9815

Cannot open assembly '/home/chrx/Omnisharp/OmniSharp.exe': File does not contain a valid CIL image.
[ERROR] Error: Failed to start OmniSharp

I still get the same error when trying rghtclk->Run Code.


I get the same as the above when changing the omnisharp.path to /home/chrx/Omnisharp/OmniSharp while I changed OmniSharp.exe back to OmniSharp

@DustinCampbell
Copy link
Member

DustinCampbell commented Nov 10, 2016

When you say that you right-click a file and choose Run Code, I'm actually not clear on where that is. I've been unable to find a "Run Code" command in VS Code. Perhaps that is coming from some other extension?

Could you try the latest v1.5-future-preview1 release of the C# extension. I suspect this may work better.

Do the following to install the new extension:

  1. Download the .vsix for the extension at the link above.
  2. Open Visual Studio Code.
  3. Select Preferences->User Settings from the menu and then removing the "omnisharp.path" and "omnisharp.useMono" settings from the settings.json.
  4. Select View->Extensions to display the Extensions pane.
  5. In the Extensions pane, click on the little gear icon next to the C# extension and select "Uninstall". Allow Visual Studio Code to reload.
  6. In the Extensions pane, click on the [...] at the top-right corner of the pane and select "Install from VSIX...". Pick the .vsix you downloaded and then allow Visual Studio Core to restart.

@Neoakb
Copy link
Author

Neoakb commented Nov 11, 2016

That's from formulahendry.code-runner

He's output after installing the new version (code-runner disabled just incase):

Updating C# dependencies...
Downloading package 'Mono Runtime (Linux / x64)' (1547 KB) .................... Done!
Downloading package 'Mono Framework Assemblies' (5494 KB) .................... Done!
Downloading package 'OmniSharp (Mono 4.6)' (12867 KB) .................... Done!
Downloading package '.NET Core Debugger (Windows / x64)' (21291 KB) .................... Done!
Downloading package '.NET Core Debugger (macOS / x64)' (20149 KB) .................... Done!
Downloading package '.NET Core Debugger (CentOS / x64)' failed (error code '404')
Failed at stage: downloadPackages
404

Finished
[ERROR]: C# Extension failed to install the debugger package

Tried to uninstall/reinstall, but that didn't change anything.

EDIT:
Here's the omnisharp log as well:
Starting OmniSharp server at 11/11/2016, 12:07:21 AM
Target: /home/chrx/Documents/TestingOmni

[ERROR] Error: spawn /home/chrx/.vscode/extensions/ms-vscode.csharp-1.5.0-future-preview1/bin/run ENOENT

@gregg-miskelly
Copy link
Contributor

@Neoakb can you give us the output from cat /etc/os-release?

@chuckries looks like we have some (multiple?) sort of issue here as it is trying to download multiple versions of the debugger, and then CentOS is giving a 404.

@Neoakb
Copy link
Author

Neoakb commented Nov 11, 2016

NAME="GalliumOS"
VERSION="2.0 (Xenon)"
ID=galliumos
ID_LIKE="ubuntu debian"
PRETTY_NAME="GalliumOS 2.0"
ANSI_COLOR="1;34"
VERSION_ID="2.0"
HOME_URL="https://galliumos.org/"
SUPPORT_URL="https://galliumos.org/"
BUG_REPORT_URL="https://github.com/GalliumOS/galliumos-distro/issues"
UBUNTU_CODENAME=xenial

@gregg-miskelly
Copy link
Contributor

@Neoakb one last question - are you trying to do .NET Core development or mono? If .NET Core, are you finding that the Ubuntu 16 version of .NET Core works well enough? Or are you using some sort of other version?

@Neoakb
Copy link
Author

Neoakb commented Nov 11, 2016

I am using this course to learn C# and wanted to be able to work while I was away. With .NET Core it seems like I'll be able to develop on and for most systems.

https://mva.microsoft.com/en-US/training-courses/c-fundamentals-for-absolute-beginners-16169?l=Lvld4EQIC_2706218949#

I'm 'technologically inclined', but I'm still a novice programmer.

@gregg-miskelly
Copy link
Contributor

@Neoakb got it. We haven't tried Gallium at all, but I can give you a test version of the C# extension later today which causes it to treat Gallium like Ubuntu 16 and you can see if that works for you.

@gregg-miskelly
Copy link
Contributor

NOTE: The CentOS failure is now being tracked with #910. Better handling of unknown Linux distros is tracked with #911. This bug will just track trying to get Gallium OS to work.

@gregg-miskelly
Copy link
Contributor

@Neoakb please try this:

  1. Download the file: csharp-1.5.0-dev-galliumos.vsix.renamed.zip
  2. Remove the '.renamed.zip' part of the extension
  3. In VS Code: View->Extensions
  4. Click the '...' to bring up the additional command menu and select 'Install from VSIX...', and navigate to the downloaded file
  5. Confirm that downloading assets succeeds
  6. Try debugging and see if that works (you can hit breakpoints, and the locals window shows your variables)

@Neoakb
Copy link
Author

Neoakb commented Nov 12, 2016

C# Output:
Updating C# dependencies...
Downloading package 'Mono Runtime (Linux / x64)' (1547 KB) .................... Done!
Downloading package 'Mono Framework Assemblies' (5494 KB) .................... Done!
Downloading package 'OmniSharp (Mono 4.6)' (12867 KB) .................... Done!
Downloading package '.NET Core Debugger (Ubuntu 16 / x64)' (29612 KB) .................... Done!

Installing package 'Mono Runtime (Linux / x64)'
Installing package 'Mono Framework Assemblies'
Installing package 'OmniSharp (Mono 4.6)'
Installing package '.NET Core Debugger (Ubuntu 16 / x64)'

Finished

Debug Console:
0 references0 references

Find
No results

    }
}

}

DEBUG CONSOLE

You may only use the C# Extension for Visual Studio Code with Visual Studio
Code, Visual Studio or Xamarin Studio software to help you develop and test your

applications.

Loaded '/usr/share/dotnet/shared/Microsoft.NETCore.App/1.0.1/System.Private.CoreLib.ni.dll'. Cannot find or open the symbol file.
Loaded '/home/chrx/Documents/TestingCSharp/bin/Debug/netcoreapp1.0/TestingCSharp.dll'. Symbols loaded.
Loaded '/usr/share/dotnet/shared/Microsoft.NETCore.App/1.0.1/System.Runtime.dll'. Cannot find or open the symbol file.
Loaded '/usr/share/dotnet/shared/Microsoft.NETCore.App/1.0.1/mscorlib.dll'. Cannot find or open the symbol file.
Loaded '/usr/share/dotnet/shared/Microsoft.NETCore.App/1.0.1/System.Console.dll'. Cannot find or open the symbol file.
Loaded '/usr/share/dotnet/shared/Microsoft.NETCore.App/1.0.1/System.Threading.dll'. Cannot find or open the symbol file.
Loaded '/usr/share/dotnet/shared/Microsoft.NETCore.App/1.0.1/System.IO.dll'. Cannot find or open the symbol file.
Loaded '/usr/share/dotnet/shared/Microsoft.NETCore.App/1.0.1/System.IO.FileSystem.Primitives.dll'. Cannot find or open the symbol file.
Loaded '/usr/share/dotnet/shared/Microsoft.NETCore.App/1.0.1/System.Runtime.Handles.dll'. Cannot find or open the symbol file.

Intellisense seems to work. I think we might be good. Don't know about those missing symbol files though. (TBH I know nothing about them either way.)

@gregg-miskelly
Copy link
Contributor

@Neoakb the 'Cannot find or open the symbol file' is normal for system assemblies. There is an issue to give that a nicer message so it doesn't sound like a problem, but we haven't fixed it yet.

Were you able to hit a breakpoint and inspect values?

@Neoakb
Copy link
Author

Neoakb commented Nov 12, 2016

I was just using a simple hello world to test. want me to test specific code or just make some variables and change them, etc.

@gregg-miskelly
Copy link
Contributor

It would be enough to just set a breakpoint on the 'Console.WriteLine' line and verify you can inspect 'args'.

@DustinCampbell
Copy link
Member

me <- thrilled that IntelliSense works!

@Neoakb
Copy link
Author

Neoakb commented Nov 12, 2016

Just tested and it worked just fine. Looks like I'm set now. Anything I should keep an eye on? When to update back to the normal C# extension and what not.

@gregg-miskelly
Copy link
Contributor

gregg-miskelly commented Nov 12, 2016

@Neoakb The only things to keep in mind are:

  • We are out of time for this to make 1.5.0, so when that comes out (probably on Monday) do NOT upgrade to it. But you have 99.99% of the same bits, so that shouldn't be a problem.
  • When 1.5.1 or 1.6 (whatever we call the next release) comes out, you should be able to safely upgrade. You may want to explicitly remove the ~/.vscode/extensions/ms-vscode.csharp-1.5.0-dev-galliumos folder to make sure that VS Code prefers the released version.

@DustinCampbell
Copy link
Member

@gregg-miskelly: What change is needed?

@gregg-miskelly
Copy link
Contributor

gregg-miskelly@cbe1e20

@Neoakb
Copy link
Author

Neoakb commented Nov 12, 2016

Awesome! Thanks for the help. Hope I helped somehow!

@DustinCampbell
Copy link
Member

merge it 😄

@DustinCampbell
Copy link
Member

The fix in the release branch now. Thanks @Neoakb! It'll be in 1.5.

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

No branches or pull requests

3 participants