An unhandled exception of type 'System.InvalidOperationException' occured in System.ServiceProcess.dll Additional Information: Cannot start service ImDisk on computer '.'.
My first assumption after getting this error was that it was not running with correct permissions. I disabled UAC, change the SC configuration as instructed on download website, ran the process as an Administrator, etc. Nothing has resolved this issue at all. Here is the exact code (stripped down to just relevant ImDisk code) as it crashes on the very first line of my RAMDisk Constructor.
public RAMDisk() { // Initalize the ImDisk Driver ImDiskAPI.LoadDriver(); IVssImplementation vssImpl = VssUtils.LoadImplementation(); vssBkupCmp = vssImpl.CreateVssBackupComponents(); } public bool CreateRAMDisk() { // Create Empty RAM Disk char driveLetter = ImDiskAPI.FindFreeDriveLetter(); ImDiskAPI.CreateDevice(50000, 0, 0, 0, 0, ImDiskFlags.DeviceTypeHD | ImDiskFlags.TypeVM, null, false, driveLetter.ToString(), ref deviceID, IntPtr.Zero); // Format the Drive for NTFS if (FormatDrive(driveLetter.ToString(), "NTFS", true, 4096, "", false)) { string workingDir = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); if (CreateSymLink(driveLetter + @":\World", workingDir + @"\World")) { CopyDirectory(workingDir + @"\World", workingDir + @"\World_Save"); CopyDirectory(workingDir + @"\World", driveLetter + @":\World"); return true; } return false; }
Edited by CrimsonGT, 13 August 2011 - 09:52 AM.