How can I publish documentation when pushing a NuGet package to nuget.org? - visual-studio

I'm building a Blazor component and want to automate the build process. Currently the package builds properly and is pushed to nuget.org with its proper license and icon files but I can't find anywhere how to include docs. I have to manually sign in to nuget.org and update the docs to point to the same github readme link.
Is there any way to automate this process?

The feature is only for nuget.org website and is not a part of nuget cli now. And you are not the only one who wants to reflect this problem.
There is a similar github link.
After feedback from many users, the Team is working hard to add this feature to nuget cli. You can follow this link to keep track of the progress.

All the data for your package should be included inside the library project (Properties). Once you build the library and upload to Nuget, the links, descriptions and everything else will be displayed when someone searched for your package and previews on visual studio or on Nuget.
Take a look here, you will see where to find everything: https://youtu.be/FTnua-kh-bY

Related

Get source code from open sourced Nuget packages

Due to the way open sourced softwares are published ( frequently, big changes ) I found It quite hard to find the original source code for the version I am using.
For example, this is one of the most used version for IdentityServer.
Lots of classes and implementation has been changed since. So I have to
1/ find the Nuget Package version.
2/ Go to the linked GitHub (or another repo) ( if available )
3/ Go to the release and hope to find the same release equal Nuget version number
4/ Download source code at that release
5/ Integrate the downloaded project into my project
Is this the standard process or there is easier / more straight forward way that I should be doing? A tool to directly pull the correct release of that open sourced Nuget package directly in Visual Studio even?
Is this the standard process or there is easier / more straight
forward way that I should be doing? A tool to directly pull the
correct release of that open sourced Nuget package directly in Visual
Studio even?
As far as I know, this is the most standard, normal, simple way to get source code of the open sourced nuget package. And there is no such VS extension or tool to get source code directly. What you list is the only formal, standard way.
Besides, the release and update of the source code is up to the author, and in my test, the latest version 4.0.0-preview.3.23 section has been committed to IdentityServer4 source code link. So you can build and debug the latest version.
Source code of all open nuget packages is published on the Github website and you can follow the guidance which is provided by the author to build and debug the source code.
For an example, when you access the nuget package IdentityServer4, you can click on the Source repository which is on the right part of the website to access the open source code link:

TFS check-in error: Could not find a part of the path

Our team works on a project with TFS as source control. Sometimes that I want to check-in some errors happen.
D:\CustomManager.1.0.7184.35750\lib\net461\CustomManager.dll: Could not find a part of the path 'D:\CustomManager.1.0.7184.35750\lib\net461\CustomManager.dll'.
I gotta go to the Packages folder and make a new folder. after that, I have to copy the previous version of the package in that and then rename it to solve the case. This way is a little annoying because sometimes after that, new errors will show with different versions.
Additional information: This error will only be shown when I update the NuGet packages.
Is there a simple way to fix this?
Seems you directly checked libraries(dlls) in to TFS and manage version control of them.
It's not a recommend way, there are multiple downsides such as it's never exactly clear which projects are using which versions of which assemblies. It's a maintenance nightmare.
Suggest you use Nuget to handle these libraries in TFS. You should compile your code, package it in Nuget and publish it. For multiple projects you can upgrade their nuget references when appropriate, or stick with the older versions if they need to. If you need to reference a known-good, stable version, you just make sure your project is configured to pull a specific version from NuGet.
TFS use Package Management that hosts NuGet, npm, and Maven packages alongside all your other TFS assets: source code, builds, releases, etc, also be able to handle the external packages.
You could add external packages to a TFS Package Management feed. When you restore the packages, select the feed. All need packages will be restored entirely. To achieve this, just use Push NuGet packages to specify the packages you want to publish and the target feed location.
More details please refer Get started with NuGet Package Management in TFS
Update:
Keep looking for old packages, this will not happen if you already referred the latest dll in project. Please double check this part.
In your situation, if you want to check the dll in source control, you should add dlls in the solution/project and use relative path. Otherwise, tfs server may not find path.
For cache issue, suggest you to clear TFS cache then restart VS, and check in again, this may do the trick.

How do i install a package I downloaded manually into visual studio?

I dont do this very often so excuse me the question is so basic.
I found an example of parallax effect online I wanted to test.
called paroller.js
So the site offered for me to download their package and I did, its now on my desktop.
And now I have no idea how to include this in my solution, I went to nuget package manager to search for it, but cannot find it.
Link to where i got it from: https://tgomilar.github.io/paroller.js/
I tried using the nuget package manager, and I googled a million different ways to install packages into solutions and all want me to use the package manager
The only thing that nuget does is to download the files build them ( if needed) and add the required references. So, you apparently want to add a js lib. You should look for the dist folder in the package that you want and import it in your page.
Note if there is not dist folder you may need to build the package which is not that simple.

How to build FaceDetect/cnn_face_detection project on github?

I want to use the https://github.com/FaceDetect/cnn_face_detection project stored on Github repository but it shows so many different files and no proper documentation is available. Can anyone tell me how to build that github project into an executable?
If the github project has releases or tag, like tornado releases on github.
Then you can run
pip install https://github.com/project_name/archive/version.tar.gz
like this:
pip install https://github.com/tornadoweb/tornado/archive/v4.3.0.tar.gz to install the github online project.
But when the project does't have release tab. You need clone the project and compile from source.
In most cases, you can run python setup.py install.
The question has a python tag. So take python project as an example.
GitHub is mostly used for code. in various languages
How to make any github project usable or executable is specific to the language and to the kind of the project itself.
Also it need to be careful with the license terms, the state of reliability and completeness of the project you intend to work on (i.e: github.com/leezivin/FaceDetection_CNN – snakecharmerb); The fact that the specific project you mention, at the time, do not have a README.md and a license file jet , let's suggest to contact the author or someone contribute/commit the sources for any further informations.
btw the project you mention appears to be a c++ language project; so you need to be able to compile and link it ( Clean an Rebuid ) in some form of executable; The specific repo: cnn_face_detection contains Visual Studio solutions and projects therefore the easy way could be by using Visual Studio and open/import the artifacts ( it depends by version of visual studio you eventually can use ).
It is also required:
to choose if you intend to trust ( or not to trust ) the code:
to take care to the paths of the dependencies referenced by the prj because likely they need to be changed to the actual paths were you clone ( download ) the sources on your own filesystem. if don't do that you may not be able to compile the solution (i.e the three projects contained in the repo ):
By looking around the project, you will find folders named "VC2010" and "VC2006". This is a good clue that this is a Microsoft Visual C (or Visual Studio) based project. Inside you will find .sln and .vcxproj files, which are "solution" and "project" files, according to this list
Download and install Visual Studio from here. There are several options, try the Community edition first.
Download the source code of the project from github. To keep it simple you can just use "Download ZIP" button on the project home page.
Run Visual Studio and follow these directions to open one of the solution (.sln) files:
On the File menu, click Open Solution. The Open Solution dialog box opens.
Navigate to the solution you want.
Click the solution folder, which displays and selects the solution file within the folder. If no solution file is visible, verify that the value in the Files of type list box is Solution Files.
Click Open.
Build using these instructions. At this point you either have an .exe or a .dll (depending on which project you're building).

NuGet Package restore for website

I am trying to use NuGet Package Restore with VS2010 + Visual Sourcesafe. It is working partially for me.
Where this is coming from: NuGet not getting missing packages
My Solution2 has asp.net website[Project1 in above image] that has another nuget package installed. Now another developer opens the Solution2 via VS2010, the automatic restore works for Library projects in Solution1. It gets all missing packages for Library projects that is referenced in this Solution2 and I see them in Solution1/packages folder.
But for Website it says external dlls i.e. pacakages missing. The issue I think is because website doesn't have a .csproj file and so it doesn't know things needs to be restored.(http://nuget.codeplex.com/workitem/1663)
Making it work partially:
Added packages/repositories.config to website solution (What is a solution folder in visual studio)
Another developer goes to VSS and get that packages folder manually. Now when he builds the solution, the Package Manager Console prompts for restore i.e. has "Restore" button. On clicking it will bring the AjaxControlToolkit.
Questions:
- Is the above approach the only and best available for Websites?
When the developer clicks "Restore" button it brings packages for Library as well to Solution1/packages along with packages for nuget. Any reason why would it do that?
Any ideas on above issues?
Per you link, nuget doesn't support websites. If you really need to use Nuget, and let's face it, everyone does, then in my opinion the best approach is to switch your website over to a web application, at which point visual studio will create a csproj file for you, detailing the nuget packages that are contained in the project.
HTH
For adding Solution level "packages" folder with repositories.config to VS Solution Explorer, I created a Solution folder and added repositories.config.
That created packages folder in the SourceSafe when I checked-in the solution.
I also found someone pointing the same thing here.
Update: I think the newer nuget is restoring the packages. But one other trick for nuget to add the dll to the bin folder it to check-in the .refresh files for AjaxControlToolkit and its dependent packages.

Resources