2

I have a requirement where I need the following control in my project. I am using MVC application in this project.

https://github.com/xdan/datetimepicker

But, I am totally unsure how I can use this control in my project, as I am doing this for the first time. I did followed the steps that they have given. I installed those packages in one of my local folder. But this folder is different location and the project I am using is in different location. Should I install this package in the location of my project where I am using this? Please someone help me with this.

user2083386
  • 135
  • 3
  • 19
  • In the Visual Studio go to `Tools ► NuGet Package Manager ► Manage NuGet Packages for Solution...` and add the `jQuery-datetimepicker` package to your project. – Jackdaw Jan 12 '21 at 20:12
  • When you use the `NuGet Packages Manager` it will install the required package under the `packages` folder in the solution directory. – Jackdaw Jan 12 '21 at 20:24
  • I tried it, but it didn't show up any results under the browse tab. – user2083386 Jan 12 '21 at 20:36
  • Did you type the `jQuery-datetimepicker` package name? – Jackdaw Jan 12 '21 at 20:38
  • Yes. I navigated to tools-> NuGet Package Manager -> Manage NuGet Packages for Solution - Browse - jQuery-datetimepicker. This gives no results – user2083386 Jan 12 '21 at 20:41
  • Then go to `Tools ► Options...`. Click on `Package Sources` under `NuGet Package Manager` and check that `Available package sources:` is set. It should be set to `https://api.nuget.org/v3/index.json`. So the **NuGet Package Manager** will use this source to obtain list of available packages. – Jackdaw Jan 12 '21 at 20:45
  • I couldn't see Available Package sources option. All I could see is the package source, which is referring to my project git branch. I am using Visual Studio 2019. – user2083386 Jan 12 '21 at 20:53
  • It's okay. In VS2019 it is `Package Sources:`; in the VS2017 is `Available package sources:`. Does the `Package sources:` set to the `https://api.nuget.org/v3/index.json` and _checked_? – Jackdaw Jan 12 '21 at 20:54
  • No. It is set to /nuget/v3/index.json which is to the project repo that I am working on. – user2083386 Jan 12 '21 at 20:59
  • This is the problem. Change it to `https://api.nuget.org/v3/index.json`. – Jackdaw Jan 12 '21 at 21:01
  • Great! I was now able to install it. Thankyou so much!!! – user2083386 Jan 12 '21 at 21:10

1 Answers1

2

Step 1: To add the jQuery DateTimePicker package to a project:

  1. In the Visual Studio go to Tools ► NuGet Package Manager ► Manage NuGet Packages for Solution....
  2. Click on the Browse tab. Type the jQuery-datetimepicker package name and wait until the available packages list is populated.
  3. Then select the jQuery-datetimepicker package, check project(s) the package to be installed and press Install button. Wait while the package is installing.

Step 2: In case the available packages list does not updated do the following:

  1. In the Visual Studio go to Tools ► Options.... In the Options dialog find out Package Sources under NuGet Package Manager and check that Package sources is set to https://api.nuget.org/v3/index.json. So the NuGet Package Manager will use this source to obtain list of available packages:

enter image description here

  1. Perform Step 1).

For additional information see Install and manage packages in Visual Studio using the NuGet Package Manager

Jackdaw
  • 7,626
  • 5
  • 15
  • 33