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

Prevents NuGet Package Manager from opening #213

Open
bhaeussermann opened this issue Nov 22, 2021 · 43 comments
Open

Prevents NuGet Package Manager from opening #213

bhaeussermann opened this issue Nov 22, 2021 · 43 comments
Labels
waiting for feedback Need feedback or more information

Comments

@bhaeussermann
Copy link

bhaeussermann commented Nov 22, 2021

Installed product versions

  • Visual Studio: 2022 Enterprise 17.0.0
  • This extension: 1.1.154

Description

When there is a problem with the configuration of a test project and the extension is enabled I cannot open the NuGet Package Manager on the project or solution.

Steps to recreate

  1. In Visual Studio, create a new solution with a .NET 6 NUnit test project (select the "NUnit Test Project" template).
  2. Make the test project "broken" by removing the Microsoft.NET.Test.Sdk NuGet package.
  3. Install / enable the "Fine Code Coverage" extension.
  4. Restart Visual Studio.
  5. Re-open the solution.
  6. Right-click the solution in the Solution Explorer and select "Manage NuGet Packages for Solution..."

Current behavior

The NuGet Package Manager doesn't open.

Expected behavior

The fact that the test project is not properly configured should not prevent the NuGet Package Manager from opening.

@tonyhallett
Copy link
Collaborator

Please check you activity logs. See #108

@tonyhallett tonyhallett added the waiting for feedback Need feedback or more information label Nov 22, 2021
@bhaeussermann
Copy link
Author

@tonyhallett deleting the .vs folder did not resolve the problem.

Here are the log entries from ActivityLog that are written when I try to open the NuGet Package Manager:

  <entry>
    <record>790</record>
    <time>2021/11/22 08:40:51.160</time>
    <type>Error</type>
    <source>NuGetPackage.ShowManageLibraryPackageForSolutionDialog</source>
    <description>XamlParseException - Provide value on &apos;System.Windows.Markup.StaticExtension&apos; threw an exception.</description>
  </entry>
  <entry>
    <record>791</record>
    <time>2021/11/22 08:41:20.206</time>
    <type>Error</type>
    <source>NuGetPackage.ShowManageLibraryPackageForSolutionDialog</source>
    <description>Exception - The component &apos;NuGet.PackageManagement.UI.PackageManagerControl&apos; does not have a resource identified by the URI &apos;/NuGet.PackageManagement.UI;component/xamls/packagemanagercontrol.xaml&apos;.</description>
  </entry>

@tonyhallett
Copy link
Collaborator

Have you tried the Steps To Create with another extension instead ?

@bhaeussermann
Copy link
Author

I disabled "Fine Code Coverage" and performed the "Steps to Create" installing the "Smooth Caret" extension instead at step 3. At step 6 NuGet Package Manager opened without issues.

@tonyhallett
Copy link
Collaborator

I followed your steps and do not have any issue. I am using the community edition though.

Microsoft Visual Studio Community 2022 (64-bit)
Version 17.0.1

Can you update your version ?

I cannot see any reason why fine code coverage should impact nuget.

@bhaeussermann
Copy link
Author

I updated Visual Studio to 17.0.1. The behavior is the same.

If the issue can't be reproduced, I'm happy to have it closed since it happens only when that particular package is not included in the project (which generally shouldn't happen).

@bhaeussermann
Copy link
Author

bhaeussermann commented Nov 23, 2021

Now all of a sudden it seems to be happening in my other solution, regardless of whether the necessary packages are included 🤔.

@tonyhallett
Copy link
Collaborator

Have you tried deleting your nuget cache ?
image

@bhaeussermann
Copy link
Author

I tried that. Still no luck 😕

@tonyhallett
Copy link
Collaborator

@bhaeussermann did you successfully install ?

@bhaeussermann
Copy link
Author

bhaeussermann commented Dec 18, 2021

@tonyhallett It's still an issue. If the extension is enabled, NuGet Package Manager won't open. I have to disable the extension and restart VS in order to open NuGet Package Manager. It happens in all of my VS solutions as far as I can tell.

I do acknowledge that the issue is non-reproducible. Perhaps I should try reinstalling Visual Studio.

@bhaeussermann
Copy link
Author

I just updated Visual Studio to 17.0.4 and it seems the issue is fixed now 🙂

@tonyhallett
Copy link
Collaborator

Good news !

@bhaeussermann
Copy link
Author

I updated Visual Studio to 17.0.5 and now the issue has reappeared 😕

@bhaeussermann bhaeussermann reopened this Jan 21, 2022
@tonyhallett
Copy link
Collaborator

Can you show me the options you have set

image

@bhaeussermann
Copy link
Author

It's exactly the same as yours 🤔

2022-01-24_06h46_07

@bhaeussermann
Copy link
Author

I had to reinstall Visual Studio because of other issues (still 17.0.5). Now it seems the issue is gone 🙂.

@tonyhallett
Copy link
Collaborator

I do hope you do not encounter it again. If you do can you check in regedit to see if visual studio has blocked the extension.

@jason-lee-rav
Copy link

I encounter the same issue all the time. Having the same option settings, and on visual studio 17.0.6. Fine Code Coverage v.1.1.161. I have to disable Fine Code Coverage extension to get the Nuget Package Manager showing. I have the same set of options as shown above. Is there any other part we can check for this issue?

@bhaeussermann
Copy link
Author

@jason-lee-rav Have you tried reinstalling Visual Studio? That's the thing that worked for me.

@jason-lee-rav
Copy link

Didn't try re-install really. Need to try it after hours.

@jason-lee-rav
Copy link

Happen to have change to VS studio upgrade to 17.1.0, and still having the same issue. I think my last bet would be re-install. I have try it tonight later, and will report back here.

@jason-lee-rav
Copy link

Took some time and reinstall VS2022, and it worked. Thanks for your suggestion @bhaeussermann.

@cutty225
Copy link

cutty225 commented Mar 1, 2022

Also having the same problem here with VS 17.1.0. Disable FineCodeCoverage extension, restart VS and Manage NuGet packages works. Re-enable FCC and NuGet manager breaks. I am not a believer in reinstalling an entire software package (e.g. Visual Studio) in order to fix an issue created by an extension. Suggest you look further into why the extension causes this issue.

@tonyhallett
Copy link
Collaborator

@cutty225

I am not a believer in reinstalling an entire software package (e.g. Visual Studio) in order to fix an issue created by an extension

Agreed not good.

Suggest you look further into why the extension causes this issue.

Doing so. Although this is not the easiest one to track down.
Ideally someone will be able to provide a repo where this is occurring / began.

Perhaps you can try https://docs.microsoft.com/en-us/visualstudio/extensibility/how-to-diagnose-ui-delays-caused-by-extensions?view=vs-2022.

@tonyhallett tonyhallett reopened this Mar 1, 2022
@Clive321A
Copy link

Finally managed to track down why NuGet package manager not showing, which led me here.

I had done a repair of VS2022 (17.1.0) which fixed the issue . and package manager showed. But a couple of hours later it stopped working again. uninstalling Fine code coverage fixed the issue and it shows again.

Is there any extra info I can provide? I couldn't find any logs, errors or anything

@tonyhallett
Copy link
Collaborator

@CliveBennett

Is there any extra info I can provide?

If there is a particular solution that appeared to introduce the issue that you can provide then great.
If you could try https://docs.microsoft.com/en-us/visualstudio/extensibility/how-to-diagnose-ui-delays-caused-by-extensions?view=vs-2022 then that might point to why there is an issue.

Although you cannot open the Nuget package manager window can you open the Package Manager Console ? Is the Package Manager Output Window Pane available ?

@tonyhallett
Copy link
Collaborator

@CliveBennett

I assume that this is not an experimental instance of VS ?

@Clive321A
Copy link

Yes its a release version of VS2022. It was happening on the prior version, I tried upgrading to see it it resolved it as I thought was a VS issue, when it didn't I also tried a Repair, which did initially resolve, but issue then reappeared, probably after I ran Unit Tests or something.

I can still use Nuget from the Package Manager window which is still available, so can add-package manually.
(No errors get reported in their though when trying to open via the Solution Explorer)

Ill have a go at the MS Docs to debug.

@tonyhallett
Copy link
Collaborator

Ill have a go at the MS Docs to debug
Appreciated.

Given that this has only been reported for vs2022 it may not be a problem in 2019.

If I could get it to occur on my machine I would have a go at building the nuget vsix.

@Clive321A
Copy link

I see this error when running VS in log mode, not sure if that means anything.

2149 2022/03/01 21:39:52.229 Error NuGetPackage.ShowManageLibraryPackageDialog Exception - The component 'NuGet.PackageManagement.UI.PackageManagerControl' does not have a resource identified by the URI '/NuGet.PackageManagement.UI;component/xamls/packagemanagercontrol.xaml'.

@cutty225
Copy link

cutty225 commented Mar 1, 2022

@tonyhallett

I've done some experimenting this morning. Disabled all extensions and created a simple project with one class and a single test. Same outcome, with FCC enabled, Manage NuGet Packages doesn't show the Package Manger window. Disable FCC and it is OK.

Comparing the two VS activity logs generated in each case, I can see the following in the log with FCC enabled that doesn't appear in with it disabled:

<entry> <record>2052</record> <time>2022/03/01 22:38:01.536</time> <type>Error</type> <source>NuGetPackage.ShowManageLibraryPackageDialog</source> <description>XamlParseException - Provide value on &apos;System.Windows.Markup.StaticExtension&apos; threw an exception.</description> </entry>

Not sure if that is of any help.

@tonyhallett
Copy link
Collaborator

@CliveBennett @cutty225

Thanks for your investigations. I will create an issue with Nuget in case this bizarrely is theirs.

@tonyhallett
Copy link
Collaborator

@bhaeussermann
Apologies, somehow I did not see that you had already provided this information. I must have viewed on mobile.

@tonyhallett
Copy link
Collaborator

tonyhallett commented Mar 4, 2022

I have cleaned up the FCC asynchronous code that may have caused this odd behaviour. I cannot do much more ( see Nuget issue ) until the issue reoccurs on my machine.

Just a thought - perhaps clearing the MEF cache can be a temporary workaround. I did this at some point after I noticed the package manager ui not opening. It may have had an effect.

There is this extension https://marketplace.visualstudio.com/items?itemName=MadsKristensen.ClearMEFComponentCache
which basically deletes the folder
C:\Users\tonyh\AppData\Local\Microsoft\VisualStudio\17.0_94a3a93c\ComponentModelCache

@tonyhallett
Copy link
Collaborator

@CliveBennett
@cutty225
@bhaeussermann

Please see NuGet/Home#11636 (comment)

@cutty225
Copy link

cutty225 commented Mar 6, 2022

Thanks @tonyhallett for following this up.

I've installed the new version of FCC this morning and the issue still exists.

As per your instructions, I have reported an issue using Visual Studio and included the DMP. Issue is here: https://developercommunity.visualstudio.com/t/NuGet-Package-Manager-prevented-from-ope/1684617

@tonyhallett
Copy link
Collaborator

@cutty225
Thanks for that.

It is possible that this code is causing the issue

return assemblyUtil.RunInAssemblyResolvingContext(() =>
........ It has been there for a long time though. Perhaps in VS2022 it is a problem

@cutty225
Copy link

cutty225 commented Mar 8, 2022

@tonyhallett I've done a couple of things this morning and, as a result, the problem has gone away.

Based on the feedback from Microsoft in the developer community issue where they mentioned MEF Cache, I took your advice and cleared the cache (deleted ComponentModelCache folder).

I couldn't find the FCC window (I had closed it sometime yesterday) so uninstalled FCC and reinstalled (turns out I didn't need to).

I also had a Visual Studio update installed (17.1.1) before all that, but I didn't re-test the issue after that install to see if it had any effect.

I suspect the MEF cache clear may have been the solution - perhaps someone else who has the issue can confirm that.

@harleydk
Copy link

Still an issue, recently updated VS2022 to 17.4.1 and can't see the package manager with this extension installed. Removing it and the package manager turns up. @cutty225 Cleared the MEF cache but it doesn't clear the issue.

@jodendaal
Copy link

I am also having this issue, Running Microsoft Visual Studio Community 2022 (64-bit) - Current
Version 17.4.2.

Tried various suggestion here but the only thing that works is if I disable the extension. Took me ages to figure out what was causing my Package Manager not to work.

@PaulMarchand
Copy link

I have the same problem. I'm running Visual Studio Community 2022 64 bit v17.4.3

If I restart the extension Fine Code Coverage disable, VS, Nuget Manager works again. And as soon as I re-enable Fine Code Coverage, restart VS, the Nuget Manager doesn't work. Exactly as described by several people. No errors, no warnings, no exceptions, nothing...

@drcgg
Copy link

drcgg commented May 8, 2023

Just reporting the same issue happens in Microsoft Visual Studio Professional 2022 (64-bit) - Current Version 17.1.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for feedback Need feedback or more information
Projects
None yet
Development

No branches or pull requests

9 participants