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

Microsoft Edge
Microsoft Edge
A Microsoft cross-platform web browser that provides privacy, learning, and accessibility tools.
2,130 questions
Windows for IoT
Windows for IoT
A family of Microsoft operating systems designed for use in Internet of Things (IoT) devices.
382 questions
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,606 questions
VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,570 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,119 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 56,026 Reputation points
    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) 56,026 Reputation points
    2022-05-17T17:39:06.15+00:00

    no, they are there for a reason

    0 comments No comments