NuGet / Home

Repo for NuGet Client issues
Other
1.48k stars 251 forks source link

Package Manager Console switches to the Error List window automatically #6408

Open vsfeedback opened 6 years ago

vsfeedback commented 6 years ago

After executing a script in the Package Manager Console, the IDE automatically switches to the Error List window.

This issue has been moved from https://developercommunity.visualstudio.com/content/problem/109238/package-manager-console-switches-to-the-error-list.html VSTS ticketId: 490850 These are the original issue comments:

Zhi Li [MSFT] on 9/13/2017, 10:23 AM (119 days ago):

Thank you for your feedback! Could you provide the repro steps for this issue? is there any error in the error list? Thanks

Anh Nguyen on 9/17/2017, 02:49 PM (115 days ago):

Same problem here

Rob Relyea [MSFT] on 9/21/2017, 03:23 PM (111 days ago):

We look forward to hearing from you!

Trevor Tosello on 9/26/2017, 00:28 PM (106 days ago):

I am running EF 2.0. However, the issue doesn't occur just when running commands against EF. Even if I publish a web app, if I am currently on the Output tab the IDE automatically switches to the Error tab even though there are no errors to report. Its not critical, I know - but its seriously annoying when watching the output window for info.

Patricio Beltran Saldivar [MSFT] on 10/3/2017, 03:03 PM (99 days ago):

Hey Trevor, I've been trying to repro this issue with no luck. I want to understand why you are having this behavior, would it be possible for you to provide a project where I can see this happening? Do you find this behavior when you create a new blank project and try to run a script or just in your existing project?

lasse-sande-meland on 11/10/2017, 04:54 AM (61 days ago):

Same thing happens to me.

VS version: 15.4.3
EntityFramework version: 6.1.3

It happens when you run commands like Update-Database etc

Jan de Kabouter on 12/20/2017, 05:01 AM (21 days ago):

Same problem here, but in a 'classic' asp.net mvc 5 project. It's really annoying.

These are the original issue solutions:

Trevor Tosello solved on 9/13/2017, 10:30 AM (119 days ago), 0 votes:

I added a video to show you how it happens. All I am doing is trying to execute PowerShell scripts. As soon as I hit <enter>, the tab changes. Its like this in v15.4 as well. No, there are no errors in the list.

jasel-lewis commented 6 years ago

Updated to VS 15.6.3 and this is still an issue for me. Very annoying. "Error List..." window reflects no errors, only warnings.

jonesy827 commented 6 years ago

This is still happening for me on VS 15.7.3, it is quite annoying.

simeyla commented 6 years ago

I literally don't know how this can not be reproducable. I just installed a brand new machine and this always happens. In addition the stop button and Ctrl+C never seem to function.

I just open a separate powershell console.

domagojmedo commented 5 years ago

I get same issue in 16.2.0 Preview 1.0, when I run EF command in Package manager console it switches to output tab

plug1n commented 5 years ago

Getting this issue on VS 15.9.13. This happens when i run a command through Package Manager Console. Have verified it happens when running "Update-Database" and "Add-Migration". If i type "c:" this bug does not happen.

If it's worth anything i have noticed the following:

  1. I get forced from Package Manager Console to Error List two times during execution of Update-Database. This is observed by manual going back to Package Manager Console quickly after being sent to Error List.
  2. If i Run "Update-Database -verbose" i see that the first "redirects" happens after -verbos logs the line: "Using StartUp project 'MyProjectName'." The second "redirect" happens after -verbose logs the line: "Using NuGet project 'MyProjectName'."

I am running VS as local admin.

simongymer commented 4 years ago

Just started using EF Core in our application and it's very annoying that this happens everytime you run a command in the package manager console.

Visual Studio 16.4.1

aortiz-msft commented 4 years ago

@v-luzh Does this repro in 16.6?

simongymer commented 4 years ago

Not sure, as I'm using 16.5.4 (latest version available to us). However, the naughty behaviour seems to have been fixed somewhere along the line.

aortiz-msft commented 4 years ago

@simongymer Thank you for the information. I suspected this got fixed in 16.5 or 16.6 due to some improvements we did for error handling. It's great to hear that seems to be the case. Please let us know if you do hit similar issues again, though. Thank you everyone for your feedback!

Camble commented 3 years ago

This issue is present in 16.8.3

ngelotte commented 3 years ago

And in 16.8.4

nkolev92 commented 3 years ago

Hey all,

It would be helpful if you can tell us what the commands you were running when this happened were. Unfortunately our team has not had a great luck reproing this issue.

ngelotte commented 3 years ago

I was running add-migration and other Entity Framework Core commands and some dotnet commands.

domagojmedo commented 3 years ago

EntityFramework6\add-migration -ConnectionStringName Redacted -StartUpProjectName Redacted -ProjectName Redacted -ConfigurationTypeName Redacted MIGRATIONNAME

just ran this and it switched to Error list in VS Community 16.8.4.

dcastenholz commented 3 years ago

Still a problem in Microsoft Visual Studio Enterprise 2019 Version 16.9.4 and EF 6.4.4

facundo771 commented 3 years ago

Still a problem in Microsoft Visual Studio Enterprise 2019 Version 16.9.6

Even mannually closing Error List window, it gets re opened and switched to after running AddMigration or UpdateDatabase from the PMC

MrChriZ commented 3 years ago

Same here EF 6.2 with VS16.10 Add-migration and update-database. Based in the UK in case it matters!

zivkan commented 3 years ago

When running EF6 commands, did they report any errors or were they successful?

Looking at EF6's powershell code, they're using .NET's reflection to call into NuGet's internal APIs, which might messing with intended behaviour: https://github.com/dotnet/ef6/blob/9e53a82f201b4f59b2ba655a07fa8d757529a529/src/EntityFramework.NuGet/tools/EntityFramework6.psm1#L788-L806

facundo771 commented 3 years ago

When running EF6 commands, did they report any errors or were they successful?

Looking at EF6's powershell code, they're using .NET's reflection to call into NuGet's internal APIs, which might messing with intended behaviour: https://github.com/dotnet/ef6/blob/9e53a82f201b4f59b2ba655a07fa8d757529a529/src/EntityFramework.NuGet/tools/EntityFramework6.psm1#L788-L806

All commands are successfully executed, but the window is still changed to Error List It also happens when publishing (instead of Output, it goes to Error List)

planetarian commented 2 years ago

This is still happening in 16.11.1 while I'm doing EFCore migrations. It switches to Error List after every executed command.

AndrueCope commented 2 years ago

This is also the cause of the Error List getting the focus randomly while executing a build. It's very annoying if you have the options 'Show Output window when build starts' and 'Always show Error List if build finishes with errors' as I have. For years now I've used the focusing of the Error List as an indication that the build has ended and I can start fixing the issues but with this current bug I'm thwarted because the Error List will keep stealing focus preventing me from editing the code.

This problem affects vs2022 Previews as well as vs2019 (Preview and Release).

facundo771 commented 2 years ago

It's just ridiculous this is still ongoing after 44 months

AndrueCope commented 2 years ago

And there are several (half a dozen at least) bug reports for the IDE complaining about the Error List focus stealing. Some died after 'More information required' but several are closed because the 'fix' is to uncheck 'Always show Error List'.

expert4pro commented 2 years ago

"Package Manager Console switches to the Error List window automatically"

This problem affects vs2019 Release actually.

Why haven't they fixed it yet?

AndrueCope commented 2 years ago

Yup - still present in vs 2022 Preview 2.

Maybe they don't care because it's a VS issue caused by NuGet intended behaviour?

If it's down to the VS team to fix it then good luck with that. They almost never fix UI issues. It appears to be a blind spot for the VS dev team and has been as long as I've been using it (over twenty years now).

nkolev92 commented 2 years ago

Hey all,

Does anyone hit this issue while not running an EF command?

As pointed out by @zivkan's the EF package has some logic that focuses the error list, https://github.com/NuGet/Home/issues/6408#issuecomment-862366885, and that could be the root cause.

AndrueCope commented 2 years ago

Me. I'm getting it while building projects and we don't use EF. The Error List comes to the focus any time Package Manager emits a message. What's curious is that sometimes Package Manager doesn't have anything to say (eg; right now ironically I don't seem able to get it to emit any warnings).

zivkan commented 2 years ago

I assume you're referring to Package Manager Console, and not the Package Manager UI (especially since the menu items are all called "Manage NuGet Packages").

An easy way to get PMC to report an error is to run commands like Get-Project -Name "DoesNotExist", or Install-Package "NoSuchPackageExists" -Version 99.99.99. When I just ran these to make sure I got the syntax right, it did not switch to the error list.

Here's one way to get a warning (albeit with an error as well): Create a .NET 5 or .NET 6 project. In PMC, run Install-Package Newtonsoft.Json -Version 6.0.1. Finally, run the Install-Package "NoSuchPackageExists" -Version 99.99.99 command. Interestingly it's necessary to use the -Version argument, otherwise the NU1701 warning won't be shown in addition to the errors.

I'm unable to reproduce the reported issue, and given I don't have any ideas why it might be switching to the error list, I need to debug a reproduction to see where/why it's happening.

AndrueCope commented 2 years ago

The warnings I was getting were just during the build. Various projects would cause NuGet to emit a warning when they compiled. Strangely today it seems to have stopped emitting any warnings despite me not doing anything related to package management.

zivkan commented 2 years ago

The title of this issue is about Package Manager Console. The closest non-PMC issue I can find it https://github.com/NuGet/Home/issues/8190, but it was closed with a code fix 2 years ago.

If you have steps that someone on a different computer can follow to reproduce the issue (outside of PMC), please create a new issue. If I can repro on my computer, in theory with access to Microsoft's internal symbol server, I can put a breakpoint in the Error List's "bring to focus" method, then check the call stack, and figure out which VS component caused it to come to focus. But I need a repro where "Always show error list when build finishes with an error" is turned off. Since any VS extension can bring any window to focus at any time, we've been unable to determine that it is in fact NuGet, especially given that we believe we fixed a known scenario years ago.

dotnet-policy-service[bot] commented 4 months ago

Issue is missing Type label, remember to add a Type label

cookston commented 2 weeks ago

Still occurring in Microsoft Visual Studio Enterprise 2022 (64-bit) - Current Version 17.10.3

This is 2394 days after the issue was first reported!

Issue is with Package Manager Console when running EF6 commands. On completion of command view switches to Error display.

DRBlagg commented 1 week ago

I had the same issue in VS 2022 v17.10.5 and found a solution. Go into the options menu, uncheck the Always show Error List if build finishes with errors option under Projects and Solutions -> General. That fixed the issue for me.

VS2022OptionFix

Camble commented 1 week ago

@DRBlagg If that works around the issue, great, but having the error list show if a build finishes with errors is a useful feature in itself.