Navigation bar missing in Visual Studio using PowerShell Tools

I’m running Visual Studio 2019 version 16.4.3 with the PowerShell Tools extension version 5.3.1 installed. I have a PowerShell module project which edits a .psm1 file. The problem is that sometimes the Visual Studio navigation bar does not appear to let me select which function in the module to go to and work with. It seems this problem started when I started using this extension in Visual Studio 2019. When I used the extension in VS 2017, the navigation bar always appeared when using this extension. I check the Visual Studio Options - Text Editor - All Languages and Navigation Bar is checked. Also, sometimes I can get the navigation bar to appear if I close the PowerShell project, open a C# project (where the navigation bar is always visible), then reopen the PowerShell project and then the navigation bar appears. But, this only works sometimes.

Hey @jrmehl,

This sounds like a bug but the first I’m hearing of it. I’ll have to look into it and see if we can figure out what’s going on there.

Thank you. Please let me know if there’s any more info I can provide.

Here’s another problem I’m seeing related to the navigation bar. Sometimes when I select a function from the navigation bar, the cursor won’t go to the selected function with the selected function scrolled to the middle of the screen. Then if I try it again, it will. This doesn’t happen all the time. It usually works like it should. I’ve not found a way to reproduce this on demand, but it happens. Thanks, and let me know if there’s more info I can provide to help.

Could you please enable PoshTools logging? You can do so in Tools->Options->PowerShell Tools->Diagnostics.

I haven’t been able to get a good handle on this issue and logging may help. I have had a hard time reproducing.

Ok. I turned on that logging, then closed Visual Studio, then reopened it and opened my PowerShell module solution. The navigation bar wasn’t there. Then I opened a non-PowerShell project, the navigation bar is there, then reopened the PowerShell project and then the navigation bar was there. Then I selected several functions from the function drop down in the navigation bar until it didn’t go to the selected function. Then I selected the same one again and then it did go to it. Then I closed the solution and Visual Studio. I’m getting a 502 error when I pasted the log file contents in this reply and tried to post. Is there another way to get that to you?

Firefox Send is handy: https://send.firefox.com/

You can DM me the link .

Here’s the link.

https://send.firefox.com/download/3511933438821ee3/#9TvcMlTZjAu4eChJ6AMANA

Here’s some more info that seems related. I have Visual Studio 2017 v15.9.4 with PowerShell Tools v4.1.4 installed on the same PC as the Visual Studio 2019 installation described already. When I use the VS 2017 installation, I don’t have the same problems with PowerShell Tools.

Also, another problem that I’m having with the VS 2019 installation that I don’t have with the VS 2017 installation is debugging. I have a PowerShell module project which has a .psm1 module file and several .ps1 PowerShell script files. From the .ps1 file I call functions in the .psm1 file and am able to run the function without problems. The stepping through of the functions works just fine and works as expected.

But, when I do the same thing with calling the same function with the VS 2019 installation it doesn’t always work right. It’s like when I call the functions they don’t actually run but there’s no error logged. But, if I set a breakpoint at the end of the function or after the function call in the .ps1 file, then it runs as expected. This doesn’t happen all the time. This problem is kind of hard to explain so this may sound confusing. Please let me know if there is any more info I can provide.

Thanks

It sounds a bit like the extension is being flaky overall for you. I looked through the log and didn’t see anything obvious that would be causing this. Because of that, I’m going to put in a little bit more logging to see if we can get to the bottom of what is happening. I’ll get a kit put together to see if we can diagnosis this better.

Yeah, it is acting odd with VS 2019. But, I’ve used it for years with prior versions and it’s been great. Thanks for your help and just let me know when you’re ready for me to run with that additional logging. Thanks.

Hello. Any news on when that kit will be available so I can provide you with more logging? Just let me know what I need to do when that’s ready. Thank you.

I just released version 5.3.5. You’ll see 2 log files. One from VS (dev.exe) and one from PowerShell.exe. If you could reproduce your issues and then send me those two log files, that would be awesome.

Adam,

Thank you. I’ve installed that version and reproduced the issues. But, one log file was updated in my \AppData\Roaming\PowerShell Tools for Visual Studio path.
I’ve attached it here. I verified that Tools – Options – PowerShell Tools – Diagnostics – Enable Diagnostic Logging was set to True.

Please let me know if you need anything else to help with this.

Thanks,

Jason

(Attachment log.devenv.exe.txt is missing)

Here’s the link for the latest log file. https://send.firefox.com/download/a13ada12ef6cca7c/#eRkPt79UVTxuFsmoQwnsQA

Thanks. You’re not the only one missing the other log file, which unfortunately is what it looks like I’m going to need. I’m currently trying to nail down why it’s not being generated for some folks and will do another release in the next day or so to fix some other issues and hopefully resolve this one.

Hello. I’m now on version 5.5.5 of PowerShell Tools. I’m still having the same problems I reported and I’m still getting just one log file created. Should I be getting two log files now with this version? The only log file that’s being created is log.devenv.exe.txt.

Thanks