Skip to content

Debugging and IntelliSense in VS Code don't work #3356

Closed

Description

@iSazonov

[x] - After update to "C# for Visual Studio Code 1.8.0" debugging don't work.

The system cannot find the file specified

[x] - IntelliSense don't work in VS Code after migrating to MSBuild (json -> csproj).

Activity

  1. added
    Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a
    on Mar 17, 2017
  2. SteveL-MSFT commented on Mar 17, 2017

    @SteveL-MSFT
    Member

    Still working for me with C# plugin 1.8.0 and VSCode 1.10.2 on Ubuntu16. You may need to follow-up with https://github.com/OmniSharp/omnisharp-vscode

  3. ealexjordan commented on Mar 17, 2017

    @ealexjordan
    Contributor

    I've been seeing something similar to this as well: dotnet/vscode-csharp#1272. I have much better luck launching PowerShell from code than attaching to a process, I can get it to work occasionally. Hopefully this is fixed soon with OmniSharp.

  4. pcgeek86 commented on Mar 17, 2017

    @pcgeek86

    I just attempted to reproduce on Mac OS X Sierra, with VSCode 1.10.2, and am unable to reproduce the reported behavior successfully.

    Perhaps there's a cache folder somewhere that's affecting you? Can you use Sysinternals tools to see which file is being accessed?

    Cheers,
    Trevor Sullivan

  5. jeffbi commented on Mar 17, 2017

    @jeffbi

    I'm seeing this on Windows in VS Code 1.10.2 with C# add-in 1.8.0.

    I am able to start PowerShell by hand then attach, but I cannot start PS from VS Code.

  6. SteveL-MSFT commented on Mar 17, 2017

    @SteveL-MSFT
    Member
  7. iSazonov commented on Mar 18, 2017

    @iSazonov
    CollaboratorAuthor

    I already thought that I only work on Windows 😄 jeffbi ✌️

  8. gregg-miskelly commented on Mar 21, 2017

    @gregg-miskelly

    Work around: Add .exe to the end of program in .vscode/launch.json:

    ...
                "program": "${workspaceRoot}/debug/powershell.exe",
    ...
    
  9. jeffbi commented on Mar 21, 2017

    @jeffbi

    Outstanding. Worked for me. Thank you.

  10. iSazonov commented on Mar 21, 2017

    @iSazonov
    CollaboratorAuthor

    From dotnet/vscode-csharp#1335

    This will be fixed in 1.9.

  11. iSazonov commented on Mar 28, 2017

    @iSazonov
    CollaboratorAuthor

    jeffbi After migration to MSBuild the IntelliSense in VS Code stopped working because now there are no json files. Could you solve this?

  12. SteveL-MSFT commented on Mar 28, 2017

    @SteveL-MSFT
    Member

    Ilya (@iSazonov) known limitation with .csproj and vscode dotnet/vscode-csharp#1156

  13. iSazonov commented on Mar 28, 2017

    @iSazonov
    CollaboratorAuthor

    Yes, thanks! I download SLN file from Staffan Gustafsson (@powercode) - it is work well. But we need fix.

  14. gregg-miskelly commented on Mar 28, 2017

    @gregg-miskelly

    I have posted a new release of the C# extension that includes the fix.

    To try it -- use the use the Installing Beta Releases instructions to install v1.9.0-beta2.

  15. jeffbi commented on Mar 28, 2017

    @jeffbi

    Ilya (@iSazonov) I'm not quite sure what you're asking me for. I can confirm that Intellisense in VS Code is no longer working.

  16. jeffbi commented on Mar 29, 2017

    @jeffbi

    Well, it worked once. Now I'm unable to build in VS Code at all. I consistently get this:

    VERBOSE: Using configuration 'Debug'
    VERBOSE: Top project directory is 
    C:\Users\jeffbi\Clients\Microsoft\GitHub\PowerShell\src\powershell-win-core
    VERBOSE: Using framework 'netcoreapp1.1'
    VERBOSE: Using runtime 'win10-x64'
    Run dotnet restore
    warn : The folder 'C:\Users\jeffbi\Clients\Microsoft\GitHub\PowerShell\src\powershell-win-core' does not contain a project to restore.
    warn : The folder 'C:\Users\jeffbi\Clients\Microsoft\GitHub\PowerShell\src\TypeCatalogGen' does not contain a project to restore.
    warn : The folder 'C:\Users\jeffbi\Clients\Microsoft\GitHub\PowerShell\src\ResGen' does not contain a project to restore.
    warn : The folder 'C:\Users\jeffbi\Clients\Microsoft\GitHub\PowerShell\test\csharp' does not contain a project to restore.
    warn : The folder 'C:\Users\jeffbi\Clients\Microsoft\GitHub\PowerShell\test\PSReadLine' does not contain a project to restore.
    warn : The folder 'C:\Users\jeffbi\Clients\Microsoft\GitHub\PowerShell\test\tools\CreateChildProcess' does not contain a project to restore.
    warn : The folder 'C:\Users\jeffbi\Clients\Microsoft\GitHub\PowerShell\test\tools\EchoArgs' does not contain a project to restore.
    Run ResGen (generating C# bindings for resx files)
    The current project is not valid because of the following errors:
    C:\Users\jeffbi\Clients\Microsoft\GitHub\PowerShell\src\ResGen(1,0): error DOTNET1017: Project file does not exist 'C:\Users\jeffbi\Clients\Microsoft\GitHub\PowerShell\src\ResGen\project.json'.
    Execution of { dotnet run } failed with exit code 1
    At C:\Users\jeffbi\Clients\Microsoft\GitHub\PowerShell\build.psm1:2359 char:13
    +             throw "Execution of {$sb} failed with exit code $LASTEXIT ...
    +             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : OperationStopped: (Execution of { ...ith exit co 
       de 1:String) [], RuntimeException
        + FullyQualifiedErrorId : Execution of { dotnet run } failed with exit cod 
       e 1
    

    I get this both with the current C# extension and with the beta Gregg Miskelly (@gregg-miskelly) referred to.

    I've tried several things including killing off and re-cloning all my local repositories, to no avail.

    Building inside PowerShell with Start-PSBuild works fine.

    I'm also able to build in VS Code in Linux, still using the 1.8.0 version of the C# plugin.

  17. gregg-miskelly commented on Mar 29, 2017

    @gregg-miskelly

    jeffbi this doesn't have anything to do with VS Code or the C# extension. All VS Code does is kick off command line build script. My fix was just about fixing launch to work without the '.exe' suffix in program.

    At any rate -- I could be wrong, but it sounds like you might have a post-preview-2 .NET CLI installed, and, at least when I briefly played with the PowerShell repo, it was still using project.json based projects. If so - those two things will not play well together. The real fix would be to update the PowerShell repo to .csproj. The hack is to fix the powershell build scripts so that instead of running dotnet build (for example) instead run dotnet <path-to-preview2-dotnet.dll> build. You are also supposed to be able to lay down a global.json to make this work, but I never had any luck with that. But maybe the .NET CLI folks fixed that before RTW.

  18. SteveL-MSFT commented on Mar 29, 2017

    @SteveL-MSFT
    Member

    Gregg Miskelly (@gregg-miskelly) we've converted PowerShell repo to .csproj from project.json files. I've also noticed that I can build from start-psbuild which calls dotnet directly while in vscode it errors out. I would suggest uninstalling all dotnet and rerunning start-psbootstrap to get the appropriate version installed

  19. jeffbi commented on Mar 29, 2017

    @jeffbi

    Got rid of dotnet and reran start-psbootstrap. All seems to be working now.

    I'm using the 1.9.0-beta2 version of the C# extension, and debugging is working well also.

    Thanks to both of you.

  20. iSazonov commented on Mar 29, 2017

    @iSazonov
    CollaboratorAuthor

    jeffbi You can use sln file from Staffan Gustafsson (@powercode) #3400 to revive IntelliSense in VS Code.

  21. changed the title [-]Debugging in VS Code don't work[/-] [+]Debugging and IntelliSense in VS Code don't work[/+] on Apr 15, 2017
  22. iSazonov commented on Apr 15, 2017

    @iSazonov
    CollaboratorAuthor

    We really need sln file in repo root folder to get IntelliSense work properly.

  23. SteveL-MSFT commented on Apr 15, 2017

    @SteveL-MSFT
    Member

    Ilya (@iSazonov) submit SLN as PR?

  24. iSazonov commented on Apr 15, 2017

    @iSazonov
    CollaboratorAuthor

    Yes.

  25. iSazonov commented on Sep 22, 2017

    @iSazonov
    CollaboratorAuthor

    VS 2017 sln was added in PR #4748

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-ExternalThe issue is caused by external component(s).Resolution-FixedThe issue is fixed.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions