using NuGet in VS 2017 with X# - easy ?!

Public forum to share code snippets, screen shorts, experiences, etc.
Post Reply
User avatar
Phil Hepburn
Posts: 743
Joined: Sun Sep 11, 2016 2:16 pm

using NuGet in VS 2017 with X# - easy ?!

Post by Phil Hepburn »

Hi guys,

In at least one of the Forum topic areas I seem to remember reading about the issues some of our colleagues were having with NuGet and their VS X# projects.

Well, this post is good news to you as it suggests an easy way to get around the NuGet problem until Fabrice sorts out the VS 2017 integration of X# into the IDE.

Lets start with a picture of success - here below is a new XSharp solution/project with the required MVVM Light assemblies used in the Reference section of the SE pane :-
XS_NuGet_01.jpg
XS_NuGet_01.jpg (80.84 KiB) Viewed 302 times
For the moment I will assume that you know how to use NuGet with C#, when the IDE works as Microsoft intended it to. But a couple of images won't go amiss anyhow ;-0)
XS_NuGet_02.jpg
XS_NuGet_02.jpg (71.14 KiB) Viewed 302 times
I opened a new C# solution/project and then used the right click context menu to access the NuGet pages.
XS_NuGet_03.jpg
XS_NuGet_03.jpg (187.88 KiB) Viewed 302 times
Search for MVVMlight (as an example of what you may be looking for).

Install what is found in the search :-
XS_NuGet_04.jpg
XS_NuGet_04.jpg (91.06 KiB) Viewed 302 times
There are more dialog boxes/screens than I show here but they are very simple and straightforward :-
XS_NuGet_05.jpg
XS_NuGet_05.jpg (60.38 KiB) Viewed 302 times
After a bit of this and that (not long) we get a C# new sample SE pane with the assemblies referenced - just like that ...... :-
XS_NuGet_06.jpg
XS_NuGet_06.jpg (72.27 KiB) Viewed 302 times
So now all we need do is ..... YES, you have guessed it, open up the XSharp new solution/project and go to add a new / extra reference - then us the 'Add Reference' dialog to navigate to the correct folder in the C# sample :-
XS_NuGet_07.jpg
XS_NuGet_07.jpg (73.62 KiB) Viewed 302 times
Use the 'packages' folder to find the correct DLLs :-
XS_NuGet_08.jpg
XS_NuGet_08.jpg (54.7 KiB) Viewed 302 times
After a few more little and simple dialogs we see this in the folder called 'net45' :-
XS_NuGet_09.jpg
XS_NuGet_09.jpg (63.1 KiB) Viewed 302 times
Then simply multiple select and click OK. And the whole process takes only a minute or two, depending on your speed and/or experience.

So you can do this now in VS 2017, and for any app and for any new X# project.

I suggest you keep one C# solution for downloading any of the NuGet stuff - and - it is not only DLLs you get in a one-off manner, but the NuGet system will inform you of version updates. You may have to periodically go into the NuGet system/screen, I haven't tested that part as yet.

I chose MVVMlight (MvvmLight) simply because I am about to use it quite soon, in one of my own apps.

I hope this helps a few of you new to VS - its actually much simpler to use than many of you think or believe!

Regards, 
Phil.
Wales, UK.
User avatar
robert
Posts: 4520
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

using NuGet in VS 2017 with X# - easy ?!

Post by robert »

Phil,

Nuget support will be included in the next build.
It is working on my machine.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
Phil Hepburn
Posts: 743
Joined: Sun Sep 11, 2016 2:16 pm

using NuGet in VS 2017 with X# - easy ?!

Post by Phil Hepburn »

Great to hear that Robert ;-0)

I know that this task / job of keeping VS integration in sync with Microsoft's frequent new releases is a huge and difficult task - BUT - it is and will be appreciated by those that need to use VS.

So thanks for trying - you and your team.

Have a nice weekend,
Phil.
Wales, UK.
Post Reply