You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+32-9Lines changed: 32 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ You can learn more about NuGet here: [nuget.org](https://www.nuget.org/)
6
6
7
7
NuGetForUnity provides a visual editor window to see available packages on the server, see installed packages, and see available package updates. A visual interface is also provided to create and edit _.nuspec_ files in order to define and publish your own NuGet packages from within Unity.
The version in brackets on the left is the new version number. The version in brackets in the **Update** button is the currently installed version.
101
101
@@ -128,13 +128,13 @@ You can change this to any other NuGet server (such as NuGet.Server or ProGet -
128
128
129
129
See more information about _NuGet.config_ files here: [https://docs.nuget.org/consume/nuget-config-settings](https://docs.nuget.org/consume/nuget-config-settings)
NuGetForUnity installs packages into the local repository path defined in the _NuGet.config_ file (`repositoryPath`). By default, this is set to the `Assets/Packages` folder. In the _NuGet.config_ file, this can either be a full path, or it can be a relative path based on the project's Assets folder. Note: You'll probably want your Packages folder to be ignored by your version control software to prevent NuGet packages from being versioned in your repository.
134
134
135
135
When a package is installed, the _packages.config_ file in the project is automatically updated with the specific package information, as well as all of the dependencies that are also installed. This allows for the packages to be restored from scratch at any point. The `Restore` operation is automatically run every time the project is opened or the code is recompiled in the project. It can be run manually by selecting the **NuGet → Restore Packages** menu item.
Note: Depending on the size and number of packages you need to install, the `Restore` operation could take a _long_ time, so please be patient. If it appears the Unity isn't launching or responding, wait a few more minutes before attempting to kill the process.
140
140
@@ -161,11 +161,11 @@ When this setting is set to `false` the assemblies of the NuGet package are only
161
161
162
162
First, you'll need to create a _.nuspec_ file that defines your package. In your Project window, right click where you want the _.nuspec_ file to go and select **NuGet → Create Nuspec File**.
Input the appropriate information for your package (ID, Version, Author, Description, etc). Be sure to include whatever dependencies are required by your package.
171
171
@@ -177,6 +177,8 @@ Press the **Push** button to push your package up to the server. Be sure to set
177
177
178
178
You can use [NuGet.Server](http://nugetserver.net/), [NuGet Gallery](https://github.com/NuGet/NuGetGallery), [ProGet](http://inedo.com/proget), etc to create your own NuGet server.
179
179
180
+
> **Note:** NuGetForUnity currently only supports NuGet Api version v1
181
+
180
182
Alternatively, you can use a "local feed" which is just a folder on your hard-drive or a network share.
181
183
182
184
Be sure to set the proper URL/path in the _NuGet.config_ file and you should be good to go!
@@ -197,3 +199,24 @@ For more information see [.Net Tool Documentaion](https://learn.microsoft.com/en
197
199
## Usage
198
200
199
201
Restore nuget packages of a single Unity Project: `dotnet nugetforunity restore <PROJECT_PATH>`. If installed as a global tool it can be called without the `dotnet` prefix: `nugetforunity restore <PROJECT_PATH>`.
202
+
203
+
# Common issues when installing NuGet packages
204
+
205
+
Unity is relatively special as it uses a different runtime, a fork of the [Mono](https://docs.unity3d.com/Manual/Mono.html) runtime, than the standerd .Net from Microsoft uses. For some platforms Unity even uses [IL2CPP](https://docs.unity3d.com/Manual/IL2CPP.html) that compiles all C# code to C++ code. So Unity also uses a different build-system. This can lead to some issues with NuGet packages that heavily depend on the standard .Net build-system. NuGetForUnity tries to handle most of the changes needed for NuGet packages to work inside Unity but it is not able to resolve all issues.
206
+
207
+
## Version Conflicts
208
+
209
+
If two NuGet packages depend on the same package but reference different versions of it, Unity shows a error like:
210
+
211
+
```
212
+
Assembly 'Assets/Packages/System.Diagnostics.EventLog.4.7.0/lib/netstandard2.0/System.Diagnostics.EventLog.dll' will not be loaded due to errors:
213
+
System.Diagnostics.EventLog references strong named System.Security.Principal.Windows Assembly references: 4.1.1.0 Found in project: 4.1.3.0.
214
+
Assembly Version Validation can be disabled in Player Settings "Assembly Version Validation"
215
+
```
216
+
217
+
As mentioned in the message this error can be suppresed by changing a setting. Just go to Edit -> Project Settings -> Player -> Scroll down and expand "Other Settings" than uncheck "Assembly Version Validation" unther the "Configuration" section.
218
+
219
+
<details>
220
+
<summary>Screenshot of Player Settings</summary>
221
+
<imgals="Assembly Version Validation settings page"src="docs/screenshots/assembly-version-validation-setting.png"height="550px" />
0 commit comments