Visual Studio Setup Project with a Unity game creates application-breaking dependency on .Net Standard 2.0


tl;dr:

How do I find the origin of a dependency in a Visual Studio Installer Project?

I’ve created a Visual Studio Installer Project in VS2022 to package my Unity game as an .msi

Visual Studio automatically creates a list of dependencies, including 2 instances of netstandard.dll:

enter image description here

However, one of these is to version 2.0 of .Net Standard
enter image description here

resulting in a game-breaking exception:

TypeLoadException: Could not resolve type with token 010001f1 from 
typeref (expected class 'System.Collections.Generic.CollectionExtensions' 
in assembly 'netstandard, Version=2.0.0.0

When I exclude this library directly in the Solution Explorer, it resolves the issue, but I don’t want to have to do that manually.

How do I find the component or library that is triggering this dependency so that I can resolve it without importing the redundant dll?

Leave a Reply

Your email address will not be published. Required fields are marked *