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

C# support not working after C# extension installed #114

Closed
jrieken opened this issue Mar 21, 2016 · 19 comments
Closed

C# support not working after C# extension installed #114

jrieken opened this issue Mar 21, 2016 · 19 comments
Assignees

Comments

@jrieken
Copy link
Contributor

jrieken commented Mar 21, 2016

From @Leocrespo on March 20, 2016 2:15

  • VSCode Version: 0.10.11
  • OS Version: 10.11.3

Steps to Reproduce:

  1. Download this file and open it with VS Code http://d.pr/f/1jczl
  2. Check if there's intellisense.

If it doesn't have intellisense, it's not an editor. Might as well use textedit.

Image of No Intellisense

Copied from original issue: microsoft/vscode#4467

@jrieken jrieken self-assigned this Mar 21, 2016
@jrieken jrieken added the c# label Mar 21, 2016
@jrieken
Copy link
Contributor Author

jrieken commented Mar 21, 2016

From @Tyriar on March 20, 2016 2:18

Did you install the C# extension? https://code.visualstudio.com/Docs/languages/csharp#_installing-c35-support

@jrieken
Copy link
Contributor Author

jrieken commented Mar 21, 2016

From @Leocrespo on March 20, 2016 2:23

Yes it's installed

Image of VSCode

@jrieken
Copy link
Contributor Author

jrieken commented Mar 21, 2016

From @Tyriar on March 20, 2016 2:28

@Leocrespo and was vscode restarted after it was installed?

@jrieken
Copy link
Contributor Author

jrieken commented Mar 21, 2016

From @Leocrespo on March 20, 2016 2:30

Yes of course. Have you tried downloading the file and opening it, I'm sure there won't be any intellisense.

@jrieken
Copy link
Contributor Author

jrieken commented Mar 21, 2016

From @Tyriar on March 20, 2016 2:40

Works fine for me. I'm on Windows 10 and had VS2015 installed before VSCode.

image

I haven't actually used the C# support before, one of the other devs might be able to help you out beyond this point.

@jrieken
Copy link
Contributor Author

jrieken commented Mar 21, 2016

From @Leocrespo on March 20, 2016 2:48

I can do that too, that's not intellisense.
Image of candothattoo

This is intellisense
Image of thisisintellisense

@jrieken
Copy link
Contributor Author

jrieken commented Mar 21, 2016

From @Tyriar on March 20, 2016 3:6

@Leocrespo this might resolve your issue http://stackoverflow.com/a/29979730/1156119

@jrieken
Copy link
Contributor Author

jrieken commented Mar 21, 2016

From @Leocrespo on March 20, 2016 3:14

  1. There isn't any option for me to create a project.json or a solution. (amazing)
  2. There is no "Open folder" command

Image of selection

@jrieken
Copy link
Contributor Author

jrieken commented Mar 21, 2016

From @Leocrespo on March 20, 2016 3:24

All I want is to have basic intellisense on the file I posted, just as I do when I open it with VS. So I created a solution in VS2015.

Image of aa

then opened everything with VSCode and still no intellisense.
Image of bb

@jrieken
Copy link
Contributor Author

jrieken commented Mar 21, 2016

From @Tyriar on March 20, 2016 7:33

Visual Studio can generate sln files as you mention, VSCode cannot. VSCode typically relies on external tools or extensions for that kind of project scaffolding.

As for the project.json, it looks like this is created using the relatively new .NET Core and dotnet CLI which uses a more folder-based approach to C# development which is more inline with what VSCode was designed to work with (as opposed to project/solution-based).

So once the .NET Core is installed, you should be able to run this to generate a project.json:

dotnet new

And then this to run your application:

dotnet restore # install deps
dotnet run

When coming back to VSCode I ran into this OmniSharp issue related to VSCode not being able to find the globally installed dnx runtime microsoft/vscode#126 (comment)


Not sure why open folder is not there, it always has been for me (I don't use OSX though).

image

You can always run the command from the command palette:

  1. Press F1
  2. Type open folder
  3. Press enter

image

@jrieken
Copy link
Contributor Author

jrieken commented Mar 21, 2016

From @pflannery on March 20, 2016 17:29

@Leocrespo just want to point out that the example you show here would never work as your trying to write the script in the c# class root scope.
In this scenario Visual studio also fails to show intellisense too

animation

Try this example project in vscode https://github.com/dotnet/core/tree/master/samples/helloworld

run dotnet restore in the root and you should get this:

image

i'm running vscode 0.10.11

@jrieken
Copy link
Contributor Author

jrieken commented Mar 21, 2016

@Leocrespo There is a Omnisharp log file (Cmd+L,L) Please paste its contents here.

@jrieken
Copy link
Contributor Author

jrieken commented Mar 21, 2016

invalid C# code as outlined here: #114 (comment)

@ghost
Copy link

ghost commented Mar 21, 2016

It's 2 steps to reproduce there error:
Download this file and open it with VS Code http://d.pr/f/1jczl
Check if there's intellisense.

If you guys don't get it, never mind, I'm not with patience to explain. Good luck with your "editor".

@ghost
Copy link

ghost commented Mar 21, 2016

VSCode, no intellisense
Image of aaa

VS 2015, same file, here's the intellisense.
Image of aaa

@jrieken
Copy link
Contributor Author

jrieken commented Mar 21, 2016

@Leocrespo #114 (comment)

@jrieken jrieken reopened this Mar 21, 2016
@DustinCampbell DustinCampbell removed the c# label Mar 21, 2016
@Tyriar
Copy link
Contributor

Tyriar commented Mar 22, 2016

This is a duplicate of #47

@colinramsay
Copy link

I had this issue on OSX. My log file shows:

[INFO] Starting OmniSharp at '/private/tmp/ConsoleApplication'...
[INFO] Started OmniSharp from '/Users/colinramsay/.vscode/extensions/ms-vscode.csharp-0.3.7/bin/omnisharp' with process id 33980...
[INFORMATION:OmniSharp.Startup] Omnisharp server running using stdio at location '/private/tmp/ConsoleApplication' on host 33971.
[INFORMATION:OmniSharp.Dnx.DnxPaths] Using runtime '/Users/colinramsay/.dnx/runtimes/dnx-coreclr-darwin-x64.1.0.0-rc1-update1'.
[INFORMATION:OmniSharp.Dnx.DnxProjectSystem] Scanning '/private/tmp/ConsoleApplication' for DNX projects
[INFORMATION:OmniSharp.Dnx.DnxProjectSystem] Found project '/private/tmp/ConsoleApplication/project.json'.
[INFORMATION:OmniSharp.Dnx.DesignTimeHostManager] Using '/Users/colinramsay/.dnx/runtimes/dnx-mono.1.0.0-rc1-update1' for design time host.
[ERROR:OmniSharp.Startup] The project system 'DnxProjectSystem' threw an exception.
System.InvalidOperationException: File name has not been set
   at System.Diagnostics.Process.Start_common (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process) in <filename unknown>:line 0
   at System.Diagnostics.Process.Start () in <filename unknown>:line 0
   at (wrapper remoting-invoke-with-check) System.Diagnostics.Process:Start ()
   at OmniSharp.Dnx.DesignTimeHostManager.Start (System.String hostId, System.Action`1 onConnected) in <filename unknown>:line 0
   at OmniSharp.Dnx.DnxProjectSystem.Initalize (IConfiguration configuration) in <filename unknown>:line 0
   at OmniSharp.Startup.Configure (IApplicationBuilder app, IServiceProvider serviceProvider, ILibraryManager manager, IOmnisharpEnvironment env, ILoggerFactory loggerFactory, ISharedTextWriter writer, IOptions`1 optionsAccessor) in <filename unknown>:line 0
[INFORMATION:OmniSharp.MSBuild.MSBuildProjectSystem] No solution files found in '/private/tmp/ConsoleApplication'
[INFORMATION:OmniSharp.ScriptCs.ScriptCsProjectSystem] Detecting CSX files in '/private/tmp/ConsoleApplication'.
[INFORMATION:OmniSharp.ScriptCs.ScriptCsProjectSystem] Could not find any CSX files
[INFORMATION:OmniSharp.Startup] Solution has finished loading

After finding this issue, the problem was solved this by installing the mono runtime with dnvm:

dnvm upgrade -r mono

@DustinCampbell
Copy link
Member

This is a duplicate of #47, which was filed by the same customer.

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

4 participants