Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for installing packages to specific assembly #664

Open
CDTR-MattConroy opened this issue Aug 20, 2024 · 2 comments
Open

Support for installing packages to specific assembly #664

CDTR-MattConroy opened this issue Aug 20, 2024 · 2 comments

Comments

@CDTR-MattConroy
Copy link

Description

It would be very useful to install packages to a specific assembly. To be able to install a package only for use in the Editor or for Testing purposes. Are there any plans to support this?

@locus84
Copy link

locus84 commented Dec 26, 2024

Disable automatic referencing of assemblies
To disable the automatic referencing of assemblies of a NuGet package you can set the autoReferenced attribute of a package inside the packages.config to false. Currently this setting is not available from UI.

<?xml version="1.0" encoding="utf-8" ?>
<packages>
    <package id="Serilog" version="2.12.0" autoReferenced="false" />
</packages>

I think this functionality solves issue for you.
you can create editor only assembly definition and connect it on your needs.

@JoC0de
Copy link
Collaborator

JoC0de commented Jan 5, 2025

Hi @CDTR-MattConroy
Unity allows you to specify witch packages (dll's) are imported to other assemblies in two ways:

  1. You e.g. install Serilog and mark it as not autoReferenced so it is not imported in any other assembly (auto generated or created from .asmdef). To include it in a assembly it than need to be explicitly listed in the .asmdef.
  2. You enable "Override References" in the .asmdef and list all packages (dll's) you need to be imported (referenced).
image

Doing this from NuGetForUnity is probably not so easy / not the most strait forward way for the user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants