nuget package manager don't show installed packages in vs2022 but yes in vs2019

Francisco Javier Alexandre Hurlé 11 Reputation points
2022-11-16T10:34:35.557+00:00

I have a project builded in vs2019. Update from vs2019 to vs2022.
Open project -> nuget package manager -> installed panel
Not found packages.
If I open the project using vs2019, I can see al the installed packages.
I I open the project using vs2022 again, I can see 'Not found package' again.
I use packages.config file with information

¿where can I define the path to packages.config in my project of vs2022?

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,919 questions
0 comments No comments
{count} vote

7 answers

Sort by: Most helpful
  1. Francisco Javier Alexandre Hurlé 11 Reputation points
    2022-11-17T13:54:05.497+00:00

    I like add information to explain better my problem.

    In vs2013 I could select web application project or web site project.

    dd547590(v=vs.110)

    261469-imagen-2938.jpg

    If I select web appplication then I have got *.xxproj file

    But if I select web site project I don't have .xxproj file.

    In vs2015 and vs2019 I was able to continue using everything the same (web site project) and I could see the installed nuget packages.

    Now, when I migate to vs2022 I was able continue using web site project but I could not see the installed nuget packages.

    I hope I helped clarify the process.

    Best Regards.

    1 person found this answer helpful.

  2. Henry Raud 6 Reputation points
    2022-11-25T15:10:04.533+00:00

    I have the same issue, since upgrading to the latest version of Visual Studio 2022 (17.4.1). I also have a legacy web site project. The issue might related to the fact that I am using a local IIS server for loading my project, as is @Francisco Javier Alexandre Hurlé . I have cleared all caches and repaired VS, but the issue persists. The only workaround is to click "Unload Project" and "Reload Project" from the Project menu. This only works until the next time I launch Visual Studio.

    Note that this was a bug introduced and fixed in VS 15 a few years ago: https://developercommunity.visualstudio.com/t/nuget-fails-for-website-projects-hosted-on-local-i/165970. It's possible that this now a new bug in VS 2022.

    1 person found this answer helpful.

  3. Tianyu Sun-MSFT 31,246 Reputation points Microsoft Vendor
    2022-11-17T03:20:08.47+00:00

    Hi @Francisco Javier Alexandre Hurlé ,

    Welcome to Microsoft Q&A forum.

    Please try following suggestions:

    1. Click Tools > NuGet Package Manager > Package Manager Settings > Package Sources > check if the related package source is set well > remove it > readd the package source and select it/them. Then right-click your project > Manage NuGet Packages... > on top right corner, select the correct package source and switch to Installed tab > click Refresh button and check if the installed packages show.261180-image.png
    2. Remove cache files/folders(.vs, bin, obj) and rebuild your project.
    3. Restore NuGet packages(Clean NuGet cache, restore) if possible.
    4. Update Visual Studio 2022 to the latest version and/or repair Visual Studio 2022.
    5. Make sure that "packages.config" is set in .xxproj file like
      261223-image.png

    Feel free to let me know if any of above suggestions works.

    • Update1:
      1. Please try to remove all folders called ComponentModelCache in C:\Users\<username>\AppData\Local\Microsoft\VisualStudio\17.0_XXXXXXXX folder.
      2. Please make sure that the folder called packages is stored in the solution folder, and the nuget packages are included in this folder.
      3. If it is possible, please try to test on another machine with VS 2022 and if the same issue appears, in case it's a potential issue, I suggest you submit a ticket on our Developer Community for further investigate.

    Best Regards,
    Tianyu

    • If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
      Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

  4. Francisco Javier Alexandre Hurlé 11 Reputation points
    2022-11-17T08:11:22.637+00:00

    Thanks for your answer.

    After read your answer I think that my problem is that I don't have .xxproj file.

    My project is a website is legacy from VS2010. Then we migrate to VS2015, later VS2019 and now VS2022.

    If I make a new project in VS2022, really I have a XXXXX.vbproj, and everything run properly for me.

    But in my case, I have only an xxx.sln file with this information:

    Microsoft Visual Studio Solution File, Format Version 12.00

    Visual Studio Version 17

    VisualStudioVersion = 17.3.32929.385
    MinimumVisualStudioVersion = 10.0.40219.1
    Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "Gespro2020", "http://localhost:57593", "{59BA838E-28E4-4D69-9056-B36F88307FB3}"
    ProjectSection(WebsiteProperties) = preProject
    UseIISExpress = "true"
    TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.8"
    Debug.AspNetCompiler.VirtualPath = "/localhost_57593"
    Debug.AspNetCompiler.PhysicalPath = "Gespro2020\"
    Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_57593\"
    Debug.AspNetCompiler.Updateable = "true"
    Debug.AspNetCompiler.ForceOverwrite = "true"
    Debug.AspNetCompiler.FixedNames = "false"
    Debug.AspNetCompiler.Debug = "True"
    Release.AspNetCompiler.VirtualPath = "/localhost_57593"
    Release.AspNetCompiler.PhysicalPath = "Gespro2020\"
    Release.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_57593\"
    Release.AspNetCompiler.Updateable = "true"
    Release.AspNetCompiler.ForceOverwrite = "true"
    Release.AspNetCompiler.FixedNames = "false"
    Release.AspNetCompiler.Debug = "False"
    SlnRelativePath = "Gespro2020\"
    EndProjectSection
    EndProject
    Global
    GlobalSection(SolutionConfigurationPlatforms) = preSolution
    Debug|Any CPU = Debug|Any CPU
    EndGlobalSection
    GlobalSection(ProjectConfigurationPlatforms) = postSolution
    {59BA838E-28E4-4D69-9056-B36F88307FB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    {59BA838E-28E4-4D69-9056-B36F88307FB3}.Debug|Any CPU.Build.0 = Debug|Any CPU
    EndGlobalSection
    GlobalSection(SolutionProperties) = preSolution
    HideSolutionNode = FALSE
    EndGlobalSection
    GlobalSection(ExtensibilityGlobals) = postSolution
    SolutionGuid = {40D4777B-189C-46B1-B3EA-65634D0924D2}
    EndGlobalSection
    EndGlobal***

    I suppose that If vs2022 try to find *.vbroject for have path to packages.config, obviously is not in my project.

    In this case, ¿how can I say to vs2022 where to find packages.config file?

    Really thanks for your help.


  5. Francisco Javier Alexandre Hurlé 11 Reputation points
    2022-11-17T13:28:06.083+00:00

    Thanks again.

    If I use right-click in my project I haven't unload project option.

    261458-imagen-2929.jpg

    If I select my project, and I use project menu, I have got a download option:

    261379-imagen-2931.jpg

    I used this option from menu. Now, I have got a message with "downloaded"

    261347-imagen-2932.jpg

    Now I use re-charged project with depedences from contextual menu

    261467-imagen-2933.jpg

    Then, nuget packet manager show installed packs.

    261491-imagen-2934.jpg

    Close solution.

    Open solution again. No packs.

    261459-imagen-2936.jpg

    And I didn't create new project file *.vbroject

    Really thanks again for your help.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.