I have made a C# Class Library that has some NuGet packages installed in it, like Azure.Core.
When the library has been compiled, I get my library as a MyLibrary.dll which is all fine. The only files that are in the output folder is the MyLibrary.dll, MyLibaby.deps.json and MyLibrary.pdb - nothing else.
Now I need to load this in Powershell by using:
Add-Type -Path "C:\Temp\MyLibrary.dll"
And this adds it fine and I can see my methods by using the Get-Member
.
When the code then starts running, I get an error saying:
'Azure.Core, Version=1.37.0.0, Culture=neutral, PublicKeyToken=92742159e12e44c8'. The system cannot find the file specified.
Have I done something wrong with the way I have done my class library or am I doing the Powershell bit wrong? As I mentioned, I don't have any more .dll files other than MyLibrary.dll
The Class Library was made in .NET Core 7.0, if that info is needed
publish
it?