question

RudolfMeier-2283 avatar image
0 Votes"
RudolfMeier-2283 asked RudolfMeier-2283 commented

linking to assemblies of powershell

hi

Question... I'm developing modules for powershell in C# and C++/CLI. And, my problem is... after compiling and trying to load it on other computers and even on my own, it cannot be loaded, because of missing dependencies. ... when I copy the System.Management.Automation.dll into the same directory, it works. Now, what I don't understand is... this assembly can be found in the GAC. ... why can it not be found? ... are there multiple which are somehow incompatible? is that the reason?

... can someone tell me how this all works? what do I have to reference in my project? what do I have to distribute with my assembly? what's the idea behind the GAC?? ... or is powershell the problem? ... did they ... somehow manage to create an assembly hell?

windows-server-powershell
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MotoX80 avatar image
0 Votes"
MotoX80 answered RudolfMeier-2283 commented

what do I have to reference in my project?

How did you add the reference in your current project? Using the reference manager? You don't have copy local set do you?

The GAC is supposed to eliminate "dll hell". You may need to ask this question in a developer specific forum.

90954-capture.jpg



capture.jpg (157.3 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I did download the PS-reference assemblies for PS 5.1 and referenced to this one. But in the end this produced only problems. Referencing via "Assemblies \ Extensions" and then "System.Management.Automation" (which is in the "Assemblies \ Extensions", not in the "Assemblies \ Framework") solved it...

I found so many sources on the internet showing the wrong way... incredible.

Thanks...

0 Votes 0 ·