2021-12-02

C++, .NET and NuGet download compiling but not linking

OK I knew it would be messy but I want to access
System.Management.Automation
from C++. Legacy stuff.
Particularly I want to pipeline stuff through PowerShell.

Using VS2022 [my project] | Add | Reference I can find the package and hit Install and it puts it in the packages.config file.
Net result nothing.

If I Add | Reference | Browse to the DLL and add that I can get the namespaces so my code compiles but when I run it it bitches about

System.IO.FileLoadException HResult=0x8013141A Message=Could not load file or assembly 'System.Management.Automation, Version=7.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A) Inner Exception 1: SecurityException: Strong name validation failed. (Exception from HRESULT: 0x8013141A)

If I copy the DLL into every relevant folder on the project still no good. I'm a long served C/C++ programmer but NuGet in C++ is new ground for me Obviously I've missed a step but I can't figure it. Google finds me 1000001 people doing it in C# but no C++ example. Please help an old man out.



from Recent Questions - Stack Overflow https://ift.tt/3DbTEUH
https://ift.tt/eA8V8J

No comments:

Post a Comment