Where are the files from packages folder referred apart from .csproj file in visual studio.

Priyanka Songra 6 Reputation points
2022-05-16T18:22:26.217+00:00

When we install nuget packages in visual studio, one folder named 'packages' gets created in the folder where .vsto solution is present and packages.config gets created in the visual studio solution and in .csproj file , we see that the WebView2 dll's and other dll's are referred from this packages folder. This generated packages folder has lot of subfolders and lot of dummy files as well, this makes folder size large (in our case it is around 19 MB and we have 10 nuget packages installed for our application).
I just tried to move the dll's that are referred in .csproj file , from packages folder to some other folder and referred the dll's from here and deleted the packages folder. On running the application , noticed that is not using WebView2 to display the web pages.
Please help us with more information on this packages folder and packages.config file. Are there any secondary dependencies also which I need to include in the folder where I am copying dll's?
Any information related to this packages folder will be helpful.

Thanks,
Priyanka

Windows for business | Windows for IoT
Developer technologies | .NET | .NET Runtime
Developer technologies | VB
Developer technologies | Visual Studio | Other
Microsoft Edge | Microsoft Edge development
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 77,926 Reputation points Volunteer Moderator
    2022-05-16T21:21:20.55+00:00

    when you build or publish, only the files the project actually references from the nuget folders are included in the bin folder. you should not be deleting the nuget folders.

    you can use package.config to define a common root folder for all the nuget packages used by all your solutions.

    0 comments No comments

  2. Priyanka Songra 6 Reputation points
    2022-05-17T17:21:43.547+00:00

    Hi @Bruce (SqlWork.com) ,

    Thanks for your response.
    We have many zero bytes files(dummy files) also inside this packages folder. Can we remove these zero bytes files?
    Listing some of the zero bytes files here for reference:
    packages/System.Memory.4.5.4/ref/netcoreapp2.1
    packages/System.Memory.4.5.4/lib/netcoreapp2.1
    packages/System.Memory.4.5.4/useSharedDesignerContext
    packages/System.Text.Json.6.0.3/useSharedDesignerContext
    packages/System.ValueTuple.4.5.0/lib/MonoAndroid10 ... and many more inside other nuget packages

    Thanks,
    Priyanka

    0 comments No comments

  3. Bruce (SqlWork.com) 77,926 Reputation points Volunteer Moderator
    2022-05-17T17:39:06.15+00:00

    no, they are there for a reason

    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.