Closed katopz closed 8 years ago
How did you create the solution/project that you are installing it into?
@ashleydavis I create new one from unity, for now I use source code instead and it's working fine.
I've tried one way of installing the promises library using nuget, it works to a point. Then Unity stomps on it.
Create a new Unity project. Using Unity add a new C# script (you need to do this so Unity can generate the project for Visual Studio). Then use "Open C# Project' from Unity's Assets menu. Now right cilck on the solution and select "Manage NuGet Package for Solution". You can now search for and install the promises library. This sets up the reference correctly in the project.
Unfortunately when you use Unity to add a new script it regenerates your project. Which strips out the reference because the Promises dll isn't in Unity's Assets directory. NuGet installs the dll to the 'packages' directory which is above 'Assets'.
This might be a solution though if we can figure out how to get NuGet to install the dll under the Assets directory.
I tried the following:
PM> Install-Package RSG.Promise
Attempting to gather dependencies information for package 'RSG.Promise.1.1.6' with respect to project 'Assembly-CSharp', targeting '.NETFramework,Version=v3.5'
Attempting to resolve dependencies for package 'RSG.Promise.1.1.6' with DependencyBehavior 'Lowest'
Resolving actions to install package 'RSG.Promise.1.1.6'
Resolved actions to install package 'RSG.Promise.1.1.6'
Adding package 'RSG.Promise.1.1.6' to folder 'C:\temp\unity51_promises_test2\packages'
Added package 'RSG.Promise.1.1.6' to folder 'C:\temp\unity51_promises_test2\packages'
Added package 'RSG.Promise.1.1.6' to 'packages.config'
Successfully installed 'RSG.Promise 1.1.6' to Assembly-CSharp
This works fine for me in Visual Studio 2015.
Although it suffers the same problem as in the previous comment. When Unity regenerates the project it strips out the promises dll.
Which version of Visual Studio are you using?
Normally we just copy the Promises dll into our Unity projects. I really want to find a way to make nuget work with Unity though so I'll keep looking into it.
Thanks @ashleydavis I'm using VS2015, and in case it's unity issue,I think you can close this issue if you want to and mention this in readme would be nice.
BTW, do you provide .dll somewhere? would be nice if you've one.
Cheers
I think I have figured out a way around this. I'll just need some time to write it up.
Having the same problem here. Couldn't make nuget work.
Are you able to create a sample Unity project to share with me? Then I can try installing via nuget and see if I get the same problem as you.
Here's my blank project by...
And failed to install after that, also via NuGet console.
Thanks
You could move to paket which sits on top of nuget and then also use unity3d.paket from wooga. That installs your dependencies into the assets folder for you, which means your vs solution will also have the references added automatically by unity, and paket just seems generally to be an improvement over nuget anyway, so worth looking at.
I've written a blog post on using Unity and NuGet. Please let me know if this helps.
http://www.what-could-possibly-go-wrong.com/unity-and-nuget/
Hi guys,
I trying to install with Unity v5.2.1f 64bit via
nuget
and got this errorAny hint to make it work please?
Thanks