We have a NuGet package in Azure Artifacts which we would like to use in our Python code. We are able to use DLLs and also assemblies from NuGet library, in Python but here we would specifically like to use NuGet package which another team built and deployed on Azure Artifacts.
Following is the code we have been able to write so far:
import clr
import unittest
clr.AddReference("System.Security.Cryptography.Algorithms")
def test(self):
self.assertTrue(issubclass(type(System.Security.Cryptography.MD5.Create()),System.Security.Cryptography.MD5))
unittest.main()
You need to install the packages using NuGet command line, copy required .dll
files to your project folder, and then add reference using clr.AddReferenceToFile('filePathToPackageDll')
.
nuget sources add -Name <SourceName> -Source <SourceURL> -username <UserName> -password <Pat>
nuget.exe restore
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With