Sudden "Assembly has duplicate references" on ALL imported assets

Loading my project today suddenly comes up with “Assembly has duplicate references” errors.

This error happens for ALL of my imported assets that have asmdefs.

Project was fine yesterday and I made no changes that could have caused anything even remotely like this (just a few minor UI work). The only thing I can think of was that the external drive it’s stored on might have disconnected while the editor was already closed but my IDE (JetBrains Rider) was still open.

I’ve done some googling and found nothing that points to a possible solution. Searching here on the forum also turns up nothing.
I have deleted the Library folder and let Unity re-create it, error persists. I’ve deleted the obj/ folder, the *csproj and *sln files. I’ve loaded into safe mode and loaded with “ignore errors”. I would remove and reinstall the assets but from past experience I’m reasonably sure that doing so will destroy the project entirely as everything where I actually USE the assets would be reset.

My exact editor version is 6000.3.8f1

A different project loads up alright.

The reference solution is always to use source control and simply revert all, or even step back one or two commits and try a reimport-all.

I’ll assume you did not use source control, which leaves you really to just sort of experiment on specific things it is complaining about, such as each reference: see if you can delete one of the references and what happens.

The other option is to make a new project and start copying stuff over, perhaps starting with all the code, to see if you get grouses. Another way is to copy the entire Assets/ folder into the new project at once, which would isolate if it is some project setting.

ALSO: make sure your external drive isn’t being backed up to some drive sync service. Those are not at all supported in Unity3D.

Do the Asmdefs actually contain duplicate references?

I think an older Rider version may have had a bug that might add such duplicates since I also had these at some point. But that must have been 2025.1 or even 2024.x.

I think I’ve got it, thanks for the help.

So someone else in the future can find this if they search (as I did):

Two things got corrupted, still not sure when and why: the Packages/manifest.json and most of my asmdef files. For the asmdef files it seems that the GUID connections broke and Unity or Rider tried to “save” it by writing the names to the asmdef files, IN ADDITION to the GUIDs. So when opening it again, of course now there were two references, plus a number of GUIDs that it couldn’t resolved, maybe they were recreated and changed, not entirely sure:

It ended up looking something like this:

In the end, a mix of manually deleting the duplicates, figuring out what the missing ones should be, or good old deleting the asmdef file and re-importing the asset fixed it. For the manifest.json I copied over the last non-broken one from my backup.

Errors are gone, project is now re-importing all assets and it looks good so far.

@Kurt-Dekker no I don’t use version control on projects I solo. I have in the past and found it more hassle than worth. I have a backup that lets me roll back any folder to any point in time in the past 30 days, that has always saved my ass so far - and in this case. Once I had figured out what the problem actually was, restoring things took maybe 20 minutes.

Heh, I’m exactly the opposite… I can’t think without having source control watching me. I tend to scribble out a lot of notes in comments, then commit it and start filling it in, removing the comments, commit it as it starts to compile and function, then try to get it running, etc.

To me source control is like having fine-grain save games while playing a really hard dungeon crawler where you might kick open a door and wake 200 lava dragons who promptly incinerate you as you stand in the doorway.

click reload

Also, thanks for coming back to post your fix. Never know who might find it helpful…

On any project with 2 or more people I consider version control a must.

On solo projects - as I said, I’ve used it in the past and rarely ever found it useful. But that might be a style question. If you work on several half-broken-until-finished features in parallel, I see how being able to switch between branches would be heaven-sent.