Page 1 of 1

Adding nuget to User code

Posted: Thu Mar 21, 2019 12:41 pm
by jsmith
Hello,
I have some User code. I would like to add the Aforge.Core nuget package and use it in my user code.
I have succesfully added the nuget package using Manage Packages.
But now my build fails at the line:
using Aforge;

with a CS0246 error
The type or namespace name 'AForge' could not be found (are you missing a using directive or an assembly reference?) (CS0246) -

I've got an itchy feeling I've missed a step, but I can't see where. Can anyone help?

Re: Adding nuget to User code

Posted: Thu Mar 21, 2019 3:03 pm
by Stub
Is the NuGet-ed package listed in the References section of the build target that's failing to compile, with the same icon as all of the other references? I mean as in not a 'warning' icon to indicate something is wrong with it?

Re: Adding nuget to User code

Posted: Thu Mar 21, 2019 3:07 pm
by jsmith
Hi Stub,
It seems that, when I ticked multiple boxes to add the nuget package to my different projects, it did not do so. Some of the projects didn't throw the error and looking at their reference folders, they had the reference. I tried at the solution level to install them again, but without success. As a solution, I have right mouse clicked on the reference folder of each project and selected Manage PAckages from there. In the dialog that pops up I have added the nuget there.
This has solved the issue for me.