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 #4467

Closed
ghost opened this issue Mar 20, 2016 · 19 comments
Closed

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

ghost opened this issue Mar 20, 2016 · 19 comments
Assignees

Comments

@ghost
Copy link

ghost commented Mar 20, 2016

  • 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

@Tyriar
Copy link
Member

Tyriar commented Mar 20, 2016

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

@ghost
Copy link
Author

ghost commented Mar 20, 2016

Yes it's installed

Image of VSCode

@Tyriar
Copy link
Member

Tyriar commented Mar 20, 2016

@Leocrespo and was vscode restarted after it was installed?

@ghost
Copy link
Author

ghost commented Mar 20, 2016

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

@Tyriar
Copy link
Member

Tyriar commented Mar 20, 2016

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.

@Tyriar Tyriar changed the title Can we please stop calling this a C# editor? C# support not working after C# extension installed Mar 20, 2016
@Tyriar Tyriar added the c# label Mar 20, 2016
@ghost
Copy link
Author

ghost commented Mar 20, 2016

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

This is intellisense
Image of thisisintellisense

@Tyriar
Copy link
Member

Tyriar commented Mar 20, 2016

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

@ghost
Copy link
Author

ghost commented Mar 20, 2016

  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

@ghost
Copy link
Author

ghost commented Mar 20, 2016

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

@Tyriar
Copy link
Member

Tyriar commented Mar 20, 2016

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 #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

@pflannery
Copy link

@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 jrieken self-assigned this Mar 21, 2016
@jrieken
Copy link
Member

jrieken commented Mar 21, 2016

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

@jrieken
Copy link
Member

jrieken commented Mar 21, 2016

This issue was moved to dotnet/vscode-csharp#114

@jrieken jrieken closed this as completed Mar 21, 2016
@ghost
Copy link
Author

ghost commented Mar 21, 2016

There's no need to send logs or try any other steps, this problem takes 15 seconds to reproduce.
Just download this file, open it with VS Code and you'll see there's no intellisense

http://d.pr/f/1jczl

@jrieken
Copy link
Member

jrieken commented Mar 21, 2016

as outlined by @pflannery here, what you trying to do isn't valid C# so you should not expect IntelliSense

@ghost
Copy link
Author

ghost commented Mar 21, 2016

It doesn't matter where you put the code, there's no intellisense.

VSCode, no intellisense
Image of aaa

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

@frideal
Copy link

frideal commented Mar 28, 2016

I can't Install C#...with ext install C# . nothing happened.

@Tyriar
Copy link
Member

Tyriar commented Mar 28, 2016

@yankun007 I believe it's quite large so it sometimes takes 30-60 seconds to download. Are you sure you waited long enough?

@dave-hillier
Copy link

dave-hillier commented Jun 26, 2017

I had this problem. I took the following steps and it started working again.

  1. uninstall all the plugins
  2. uninstall VSCode
  3. reinstall and open the project in VS Code
  4. reinstall the c#
  5. still not working after reload
  6. Restart & reopen

it started downloading Omnisharp and added some files to my project.

I think its unfair that this was closed, however, it looks like some kind of setup problem.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants