Background: We have a system where we control our VMM-based cloud from a .Net service. The only non-GUI interface to VMM is via Powershell commandlets. We execute these commandlets from C# code and this works fine for most commands except for Import-SCLibraryPhysicalResource.
We use Import-SCLibraryPhysicalResource to import answer files into the library so they can then be used for creating new VMs. Creating files on the file share is not enough as VMM is not aware of any new files until it has synced its view of the share. We tried Read-SCLibraryShare earlier but had issues as some answer files were not picked up by this command.
Running Import-SCLibraryPhysicalResource on the Powershell command line by hand works fine. The answer file gets imported and visible to VMM as expected. But when I run Import-SCLibraryPhysicalResource from our C# code I get this exception:
Could not load file or assembly 'Microsoft.BackgroundIntelligentTransfer.Management.Interop.dll' or one of its dependencies. A dynamic link library (DLL) initialization routine failed. (Exception from HRESULT: 0x8007045A)
This DLL does exist on my system and to be sure I have referenced it in my project.
Thanks for any hints. / Sven