System.Runtime.InteropServices.COMException

Hi everyone,

I’ve just tried to build UE4, and I get the error bellow. I’m using VS 2013 Express, and 64.
I followed along with the guide on the Unreal Engine youtube channel as closely as I could.
A quick google brings me to this hotfix, http://support.microsoft.com/kb/973746, but I can’t figure out how to install it.
If that’s even going to help. Any help on getting this to successfully build would be great.

1>------ Build started: Project: UE4, Configuration: Development_Editor x64 ------
1>  Building UnrealHeaderTool...
1>EXEC : error : System.Runtime.InteropServices.COMException (0x80070422): The service cannot be started, either because it is disabled or because it has no enabled devices associated with it. (Exception from HRESULT: 0x80070422)
1>     at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
1>     at System.Management.ManagementScope.InitializeGuts(Object o)
1>     at System.Management.ManagementScope.Initialize()
1>     at System.Management.ManagementObjectSearcher.Initialize()
1>     at System.Management.ManagementObjectSearcher.Get()
1>     at UnrealBuildTool.LocalExecutor.ExecuteActions(List`1 Actions) in e:\UE4\UnrealEngine\Engine\Source\Programs\UnrealBuildTool\System\LocalExecutor.cs:line 334
1>     at UnrealBuildTool.UnrealBuildTool.ExecuteActions(List`1 ActionsToExecute, String& ExecutorName) in e:\UE4\UnrealEngine\Engine\Source\Programs\UnrealBuildTool\System\ActionGraph.cs:line 269
1>     at UnrealBuildTool.UnrealBuildTool.RunUBT(String[] Arguments) in e:\UE4\UnrealEngine\Engine\Source\Programs\UnrealBuildTool\System\UnrealBuildTool.cs:line 1174
1>  Cumulative action seconds (6 processors): 0.00 building projects, 0.00 compiling, 0.00 creating app bundles, 0.00 generating debug info, 0.00 linking, 0.00 other
1>  UBT execution time: 4.16 seconds
1>  UnrealHeaderTool failed for target 'UE4Editor' (platform: Win64, module info: E:\UE4\UnrealEngine\Engine\Intermediate\Build\Win64\UE4Editor\Development\UnrealHeaderTool.manifest).
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.MakeFile.Targets(38,5): error MSB3073: The command "..\..\Build\BatchFiles\Build.bat UE4Editor Win64 Development" exited with code -1.
========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========

Sorry to bump, can anyone help with this? While I can run the engine from the launcher download, I can’t do anything relating with code.

Since it’s to do with this COM service, I went into Services in Admin tools on my control panel, scrolled down to COM+ Event System, and COM+ System Application, both of which are running.

Hi Singular1ty,

Just a basic question to get out of the way first. What version of Visual Studio 2013 Express are you using?

Hi , thanks for the reply.

It’s VS2013 for Windows Desktop, Version 12.0.21005.1 REL

Hi Singular1ty,

I checked with some of our developers about this error message that you are seeing. None of them were really sure what the cause is, but the general consensus was that there is something at the OS level that isn’t working as it should. One of the developers checked in a change to the Master branch that should handle this particular issue more gracefully. You are welcome to pull down that commit and merge it into your source code to see if it helps.

Also, would you be able to provide your dxdiag information so we can take a look and see if anything obvious stands out about that?

Hi ,

Here’s the DxDiag, DxDiag - Pastebin.com.

I’d love to try out this change, but I’m afraid I’m new to github, I don’t know how to merge it to the source code on my machine.

Edit - Quick work around, I copy/pasted into the code on my end and it’s compiling now, there are some errors about “Unable to get number of cores: System.Runtime.InteropServices.COMException” though.
I’ll paste the output log when it’s finished.

Hi ,

This build succeeded, after 3294 seconds. The various processes associated with the build never used more than 30% cpu though, according to Task manager.

Here is the output from the build, 1>------ Build started: Project: UnrealBuildTool, Configuration: Development Any - Pastebin.com .

Building the Engine can take a significant amount of time, depending on your computer. I am a little surprised that it capped your CPU usage at around 30%, though. Any time I have built the Engine, it frequently uses most, if not all, of the CPU.

The “Unable to get number of cores” message is what is provided by the fix that was submitted today. It allows the Unreal Build Tool to fall back on the actual count of physical cores available and continue running instead of failing the build entirely.

Ah yeah I see that now. My apologies, I would have noticed that if I had paid attention to the code in the fix.

I’m intrigued though how this change fixed the issue, that’s brilliant. I’d like to thank you and the developers :).

In future, if I build a new project from code and add new classes via the editor, will it still take about an hour to rebuild?

The change that was submitted didn’t actually “fix” the underlying issue. Instead, it allows the Unreal Build Tool to continue running when the COM process fails. We are still not sure why that process is not working correctly for you.

When you create a new code project using the Engine that you built from source code, you will see three folders inside the Solution in Visual Studio: Engine, Games, and Programs. Engine contains the UE4 source code, Games contains your game project, and Programs contains additional code that is not directly part of the Engine.

When you are working on your project, make sure to only build the game project, and not the solution (which would include all of the Engine source code). The first build will be the longest one, though it should not be nearly as long as when you built the Engine. Subsequent builds will only compile the changes that have been made since the last build, so they should be much shorter.