![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Dynamic load of assembly problem I'm writing a cmdlet that communicates with a web service. I have generated a web service proxy dll and a serialization assembly for it. But when the cmdlet tries to load that dlls at runtime it fails. This is because the loader believes that its Appbsae directory is the powershell one - file:///C:/WINDOWS/system32/windowspowershell/v1.0/ As far I've found two "bad" solutions for that problem: 1. GAC the assemblies 2. Copy them to the powershell directory Is there a better solution for that problem, maybe some way to change the directories being searched? Thanks, Kostadin |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Dynamic load of assembly problem Kostadin Georgiev wrote: Quote: > I'm writing a cmdlet that communicates with a web service. I have generated a > web service proxy dll and a serialization assembly for it. But when the > cmdlet tries to load that dlls at runtime it fails. This is because the > loader believes that its Appbsae directory is the powershell one - > file:///C:/WINDOWS/system32/windowspowershell/v1.0/ > As far I've found two "bad" solutions for that problem: > 1. GAC the assemblies > 2. Copy them to the powershell directory > > Is there a better solution for that problem, maybe some way to change the > directories being searched? > > Thanks, > Kostadin I hate to see something go unanswered. Are you able to share your code? (Perhaps check http://www.thescripts.com/forum/thread248203.html) Marco -- ---------------- PowerGadgets MVP http://www.powergadgets.com/mvp Blog: http://marcoshaw.blogspot.com |
My System Specs![]() |
| | #3 (permalink) |
| | RE: Dynamic load of assembly problem How are you loading the assemblies? have you tried [reflection.assembly]::LoadFile(path_to_dll) -- Richard Siddaway Please note that all scripts are supplied "as is" and with no warranty Blog: http://richardsiddaway.spaces.live.com/ PowerShell User Group: http://www.get-psuguk.org.uk "Kostadin Georgiev" wrote: Quote: > I'm writing a cmdlet that communicates with a web service. I have generated a > web service proxy dll and a serialization assembly for it. But when the > cmdlet tries to load that dlls at runtime it fails. This is because the > loader believes that its Appbsae directory is the powershell one - > file:///C:/WINDOWS/system32/windowspowershell/v1.0/ > As far I've found two "bad" solutions for that problem: > 1. GAC the assemblies > 2. Copy them to the powershell directory > > Is there a better solution for that problem, maybe some way to change the > directories being searched? > > Thanks, > Kostadin |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Dynamic load of assembly problem On Sep 27, 8:40 am, Kostadin Georgiev <KostadinGeorg...@xxxxxx> wrote: Quote: > I'm writing a cmdlet that communicates with a web service. I have generated a > web service proxy dll and a serialization assembly for it. But when the > cmdlet tries to load that dlls at runtime it fails. This is because the > loader believes that its Appbsae directory is the powershell one - > file:///C:/WINDOWS/system32/windowspowershell/v1.0/ > As far I've found two "bad" solutions for that problem: > 1. GAC the assemblies > 2. Copy them to the powershell directory > > Is there a better solution for that problem, maybe some way to change the > directories being searched? > > Thanks, > Kostadin even when you _do_ get your assembly loaded, there may be additional constraints. I recommend you digest some of the inimitable Suzanne Cook's (a CLR dev) excellent blog entries on the subject: "LoadFile vs. LoadFrom" http://blogs.msdn.com/suzcook/archiv...-loadfrom.aspx "Binding Contexts" http://blogs.msdn.com/suzcook/archiv.../29/57143.aspx "Switching to the Load Context" http://blogs.msdn.com/suzcook/archiv.../13/57180.aspx To be read in roughly that order. ;-) Hope this helps, - Oisin / x0n |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Can't load assembly | Software | |||
| Exception: Could not load file or assembly or one of its dependenc | PowerShell | |||
| Problem loading an assembly referencing a non-.NET dll | PowerShell | |||