Forum Discussion
Omer_Iqbal_6912
Apr 12, 2011Nimbostratus
Issues with iControl.dll on network?
Hi:
I have a few PowerShell Cmdlets in a dll that in turn uses iControl.dll to access configuration in the F5 switch. Execution from a local machine succeeds, however, when the module is imported from the network and Cmdlets are executed, iControl seem to be unable to access the F5 switch. Unfortunately, since interfaces.initialize only returns a true or a false, it is not clear what exactly the issue is.
Two questions:
1) What is the best mechanism to get a detailed log of what is happening within iControl, or last error code/message?
2) Are there any known security or code access restrictions on iControl.dll that may be preventing it from accessing the F5 switch?
Thanks,
Omer
- If an exception occurs during the initialize call in the iControl.Interfaces class, any internally caught exception is stored in the m_lastException private member that is accessible with the LastException() accessor.
boolean success = _interfaces.initialize(bigip, user, pass); if ( ! success ) { Exception ex = _interfaces.LastException(); Console.WriteLine(ex.Message.ToString()); }
- Omer_Iqbal_6912NimbostratusHi Joe,
- Omer_Iqbal_6912NimbostratusJoe, this was quite helpful. I downloaded v10 and it does indeed have LastException property.
- Ok, this is bizarre as a 403 error indicates the calling application is attempting to access a resource on the server that isn't allowed (ie, trying to browse a directory or hit a resource that doesn't have access on it). I have no clue why running the assembly from one location would effect the URL it's trying to access. Internally the assembly is building a URL like this
- Omer_Iqbal_6912NimbostratusI'll let you know once I figure it out -- thanks for this information and help! I'll try to debug on the server side too and see if the connection is even attempted on the server or not.
- Omer_Iqbal_6912NimbostratusTurned out to be a pretty easy issue -- IE proxy was set up to automatically detect settings, removing that resolved this issue -- perhaps something related to how the local server is set up. Now the network drive issue has resurfaced, but with the exception log available now, it is much easier to see what's happening. When the DLL is loaded from the network, iControl is apparently unable to bind to System.dll and since initialize probably catches all exceptions, it was only returning false which was making it harder to root cause the issue.
- I did some searching on this error and it seems it has to do with the trust level the application is running under. I've got some solutions for ASP or native apps with a main routine, but PowerShell isn't using the same model so I'm not quite sure how to tackle this one. I'll keep digging.
- This one might help... http://social.technet.microsoft.com...eeb7fd4019 -Joe
- And another...http://pscx.codeplex.com/discussions/215223
Set-Alias CasPol "$([Runtime.InteropServices.RuntimeEnvironment]::GetRuntimeDirectory())CasPol.exe" CasPol -polchgprompt off -machine -addgroup 1.2 -url file://\\YourServer\Modules\* FullTrust
- Omer_Iqbal_6912Nimbostratus
Hi Joe,
$dllFullPath = '\\SomeServer\Share\iControl.dll' $evidence = [System.Reflection.Assembly]::GetExecutingAssembly().Evidence [System.Reflection.Assembly]::LoadFrom($dllFullPath,$evidence)
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects