Why Does the Project dll get replaced on every unity reset?

Hi, I am making an asset that is running into a littlie bit of a problem.

The problem is caused by, the “project\Library\PackageCache” files are getting overwritten by the “AppData\Local\Unity\cache\packages” every time I close unity and reopen the project.

My Question is:

  1. why does this happen?
  2. what function is triggering this?
  3. where is there script that is triggering this?

Thanks in advance!

Hi @Mortalanimal , what you are describing is the Package Manager keeping the “project cache” in-sync with the “global cache”. The global cache is where all packages get downloaded for the first time, they are then copied to the project cache which allows scripts to be updated by the API Updater while the original package remains immutable in the global cache. The code that triggers this cache-syncing is not in the Unity Editor, it lives in the Unity Package Manager executable and cannot be changed. Could you explain more about what you are trying to accomplish? Maybe we can help you out :slight_smile:

Thank you for your reply,

I am making an asset that is an extension to TMP, for that to work I need to keep a few files in the Local TMP dll folder. But it gets deleted/overridden every time you restart unity. This mean I will need to add these files to the Global dll. I was hoping to avoid that because new project would also contain these extra file. That said, these files are very safe and it doesn’t effect TMP in anyway, they are only required for this TMP extension(my asset) to function. If they don’t download the asset in a new project, nothing changes, and their TMP would work just like before despite the new files.

Is there another way to go about doing this?

I would also add a window in which they can remove all these extra files (from the local and global dll) if the user wishes to do so, with a click of a button.

I personally have used this assets in a few projects including apps that are currently live and I have never needed to remove these extra files from the global nor Local dll, even in those projects that dont use this TMP-extension asset.

of course, the installation and uninstallation process is all automated using an Installation window.

your guidance would be much appreciated!