...
Gather information about the DLL. You will need the file name, a brief description, the company name, the version number of the DLL and version of .NET your application is using (usually .NET 4.7.1).
The version as well as other information about the DLL can be found in the project file and in the DLL itself. First, unload the.vbproj
or.csproj
file in Visual Studio.
Then click on the unloaded project and it will open in the editor. Find the DLLs that do not load.
Locate the missing DLL file to obtain its information. The missing DLLs can sometimes be found in the dev, acc, or prod deployment folder, under thebin
folder. These folders are usually indicated on the Applications page.Right-click and open the Properties of the DLL file to obtain its information.
Modify the Generic
.nuspec
file you downloaded from the prerequisites section above to suit the DLL file you are creating this package for, using the information gathered in step 1, entering the:
1. Filename (without.dll
)
2. Version number
3. Company name (or copyright information)
4. Description
5. The version of .NET your application is usingSave the nuspec file using the same name as the DLL file, with the
.nuspec
extension instead, in yourartifacts
folder. For example:AjaxControlTookit.nuspec
.Place your dependencies inside a
lib\[framework short code]
folder.It should also be placed under the framework version short code that the library supports. For example, you should create a subfolder called
net45
if your library supports .NET 4.5. This needs to correspond to the value you entered in step 2 #5.From your
artifacts
folder, run the following command:nuget pack
Your nuget package is now ready for uploading.
...
With your directory structure set up according to the above instructions, all that’s left to do is run the following command from within the
artifacts
folder.nuget push -Source DSD-CIVAV-Support-Feed -ApiKey az .\AjaxControlToolkit.3.5.40412.nupkg
You will be prompted to log into Azure DevOps including approving the 2FA request, if applicable.
...
Create a Project-Related NuGet file
Anchor |
---|
...
|
...
|
For projects to use the Azure Artifacts feed, you must include the following nuget.config file in the root of your project.
...
An error we encountered is when cloning a project with spaces. NuGet does not like this. Consider removing or replacing the %20
with a -
(hyphen) in your folder name.
.NET Short Codes
Anchor | ||||
---|---|---|---|---|
|
Here are some short codes that can be used as a reference. For example, .NET 4.7.2 would require a folder named net472
. Here’s a shortened list.
Name | Short Code |
---|---|
.NET Framework 2.0 | net20 |
.NET Framework 3.5 | net35 |
.NET Framework 4.0 | net40 |
.NET Framework 4.5 | net45 |
.NET Framework 4.5.1 | net451 |
.NET Framework 4.7.1 | net471 |
.NET Framework 4.7.2 | net472 |
.NET Framework 4.8 | net48 |
For the full list of version numbers, see the below list:
Target Frameworks Reference for NuGet | Microsoft Docs
Helpful Links
NuGet CLI push command | Microsoft Docs
...