Unity中的NuGet软件包 [英] NuGet packages in Unity

查看:244
本文介绍了Unity中的NuGet软件包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Unity中使用一些NuGet软件包.我实现了Unity根据本文找到下载的DLL( https ://www.what-c​​ould-possfully-go-wrong.com/unity-and-nuget/).可以将nuget.config文件配置为将软件包下载到Assets文件夹内的Plugins文件夹中.问题在于NuGet下载每个DLL的多个版本(例如net46,netcore50,netstandard21等),而Unity不喜欢多个同名的DLL.我知道我可以简单地手动将DLL放在Plugins文件夹中,但是不幸的是,这不是一种令人满意的解决方案.

I want to use some NuGet packages inside Unity. I achieved that Unity finds the downloaded DLLs according to this article (https://www.what-could-possibly-go-wrong.com/unity-and-nuget/). The nuget.config file can be configured to download the packages into the Plugins folder inside the Assets folder. The Problem is that NuGet downloads multiple versions of each DLL (eg net46, netcore50, netstandard21, so forth) and Unity doesn't like multiple DLLs with the same name. I know I could simply put the DLL inside the Plugins folder by hand, but unfortunately that is not a solution which would please me.

您是否知道我该如何解决此问题?是否可以将NuGet配置为仅为每个依赖项下载一个DLL?

Do you have any idea how I could work around this problem? Is it possible to configure NuGet to just download one DLL for each dependency?

推荐答案

我以为我会添加它,以防对任何人有帮助

Just thought I'd add this in case it helps anyone

我使用了 Nuget for Unity 资产(免费)来导入软件包(websocketsharp),真的很容易,也很轻松. VS中的引用也可以立即工作

I used the Nuget for Unity asset (free) to import a package (websocketsharp) and it was really easy and painless. The references in VS worked immediately as well

您要自然导入的软件包必须与Unity兼容,但是即使您手动导入也是如此.所以我建议尝试一下

The package you're trying to import naturally has to be compatible with Unity but that's the same even if you import it manually. So I'd recommend giving this a try

这篇关于Unity中的NuGet软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆