System.DllNotFoundException AND 0x80070005 GetVolumeRootFromPath

Mar 19, 2013 at 11:28 PM

First of all: Thank you very much to create this wrapper!
Most times i had to automate WIM tasks i was working with "cmd /c DISM... > output.txt" calls and reading the output to let the tools decide what to do next. This is neither comfortable nor responsive and so i was very happy to find this project.

But I'm facing a few problems now using the wrapper and after many hours of turning around the same issues I hope you can help me out.
The problems started using your compiled DLL. I've created a reference in a new Console Application project and tried to do some easy tasks, but just recieve the "System.DllNotFoundException". The DismApi.dll is located in "C:\Program Files (x86)\Windows Kits\8.0\Assessment and Deployment Kit\Deployment Tools\x86\DISM" on my system, but the wrapper can't find it.
So I've downloaded the source code, "hard coded" the path to the DLL in the "NativeMethods.cs" and after this the "System.DllNotFoundException" was gone.
Now the first test app to read the Index of the WIM file worked fine and rocket fast!

But now I have serious problems mounting / unmounting WIM files. The mount process starts and after about one minute there are about 17.000 files in the mount folder. Then suddenly the process stops and an exeption is thrown saying something like "unable to access D:...\Temp\2983213....". After this the mount folder is totally messed up. Trusted Installer is the owner and I've to do some manuel tasks (Change owner recurse, change persmissions recurse, delete the folder, perform dism /cleanup-wim...) to cleanup the system before i can give it another try.

Most times the logfile only contains chinese symbols.
But one time i got readable text saying "...[0x80070005] GetVolumeRootFromPath..." a few hundred times.

Manual mounting / unmounting the same WIM to the same folders with DISM in cmd works fine.
Any helpfull ideas would be great!