You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Debugging and IntelliSense in VS Code don't work #3356
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.
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
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.
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
Activity
SteveL-MSFT commentedon Mar 17, 2017
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
ealexjordan commentedon Mar 17, 2017
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.
pcgeek86 commentedon Mar 17, 2017
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
jeffbi commentedon Mar 17, 2017
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.
SteveL-MSFT commentedon Mar 17, 2017
CC David Wilson (@daviwil)
iSazonov commentedon Mar 18, 2017
I already thought that I only work on Windows 😄 jeffbi ✌️
gregg-miskelly commentedon Mar 21, 2017
Work around: Add
.exeto the end ofprogramin .vscode/launch.json:jeffbi commentedon Mar 21, 2017
Outstanding. Worked for me. Thank you.
iSazonov commentedon Mar 21, 2017
From dotnet/vscode-csharp#1335
iSazonov commentedon Mar 28, 2017
jeffbi After migration to MSBuild the IntelliSense in VS Code stopped working because now there are no
jsonfiles. Could you solve this?SteveL-MSFT commentedon Mar 28, 2017
Ilya (@iSazonov) known limitation with .csproj and vscode dotnet/vscode-csharp#1156
iSazonov commentedon Mar 28, 2017
Yes, thanks! I download SLN file from Staffan Gustafsson (@powercode) - it is work well. But we need fix.
gregg-miskelly commentedon Mar 28, 2017
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.
jeffbi commentedon Mar 28, 2017
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.
jeffbi commentedon Mar 29, 2017
Well, it worked once. Now I'm unable to build in VS Code at all. I consistently get this:
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-PSBuildworks fine.I'm also able to build in VS Code in Linux, still using the 1.8.0 version of the C# plugin.
gregg-miskelly commentedon Mar 29, 2017
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 rundotnet <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.SteveL-MSFT commentedon Mar 29, 2017
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
jeffbi commentedon Mar 29, 2017
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.
iSazonov commentedon Mar 29, 2017
jeffbi You can use sln file from Staffan Gustafsson (@powercode) #3400 to revive IntelliSense in VS Code.
[-]Debugging in VS Code don't work[/-][+]Debugging and IntelliSense in VS Code don't work[/+]iSazonov commentedon Apr 15, 2017
We really need sln file in repo root folder to get IntelliSense work properly.
SteveL-MSFT commentedon Apr 15, 2017
Ilya (@iSazonov) submit SLN as PR?
iSazonov commentedon Apr 15, 2017
Yes.
iSazonov commentedon Sep 22, 2017
VS 2017 sln was added in PR #4748