Installing Office into Windows Container (servercore:ltsc2019) failed with error code 17002


Error Message

ODT (Office Deployment Tool) log reported error when installing into Windows Container (Server Core): C2R client returned failing error code, error code: 17002


  • Behavior in Windows Server 2019 (1809) with Desktop Experience installed.
    • ODT installation Result: Succeeded.
    • test-o365.ps1: Succeeded.
  • Behavior in Container (
    • ODT installation Result: Negative (C2R client returned failing error code, error code: 17002)
    • test-o365.ps1: Negative: HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)


WORKDIR C:/setup
COPY . . 
ENTRYPOINT startup.cmd


curl.exe  --output .\
officedeploymenttool_12325-20288.exe /quiet /passive /extract:.
setup.exe /configure o365.xml
powershell -file test-o365.ps1


  <Add OfficeClientEdition="64" Channel="Monthly">
    <Product ID="O365ProPlusRetail">
      <Language ID="en-us" />
  <!--  <Updates Enabled="TRUE" Channel="Monthly" /> -->
  <Display Level="None" AcceptEULA="TRUE" />
  <Logging Level="Standard" Path="." />
  <!--  <Property Name="AUTOACTIVATE" Value="1" />  -->


# Write current datetime into result.xlsx to verify that Office COM component is working.
$filename = [System.Environment]::CurrentDirectory + "\result.xlsx"
if ([System.IO.File]::Exists($filename )) {    
    Remove-Item $filename 
$xl=New-Object -ComObject Excel.Application
$ws.Cells.Item(1,1)= [System.DateTime]::Now

More information

We are already aware of 'server-side Automation of Office' issues as mentioned in article [3]. At current stage, we are evaluating the possibility on running legacy ASP.NET application in Windows container, with Office/COM inter-operation enabled.


  1. Overview of the Office Deployment Tool
  2. What is the Server Core installation option in Windows Server?
  3. Considerations for server-side Automation of Office
asked on Stack Overflow Mar 31, 2020 by Kai Wang

1 Answer


I've been struggling with this for a while, and finally got it to work. I found the solution to the 17002 error was to run the setup.exe /configure config.xml while running the docker image interactively, and then committing that container. This worked for me on the windows:1809 image.

Full writeup

I'm copying the downloaded office files into the docker image separately, as I was having issues with getting the download to work from inside the docker file (see here). So I have the folder Office at the same level as the docker file with the contents of setup.exe /download config.xml. Then the docker file below builds a base image. I ran docker run -it {IMAGEID} powershell, navigate to C:\\odtsetup and with the interactive console run setup.exe /configure config.xml, exit the container and run

docker stop {CONTAINERID}
docker commit {CONTAINERID}` 

I now have a base windows server image with docker installed, and can use it in the dockerfile for my application. If I need to update the server image or excel version I'll need to do this manually again, but I'm just thankful it's working.


WORKDIR C:\\odtsetup
ADD odtsetup.exe
RUN odtsetup.exe /quiet /norestart /extract:C:\\odtsetup
ADD config.xml .
ADD Office Office\\


  <Add OfficeClientEdition="64" Channel="PerpetualVL2019">
    <Product ID="O365ProPlusRetail">
      <Language ID="MatchOS" />
      <ExcludeApp ID="Access" />
      <ExcludeApp ID="Groove" />
      <ExcludeApp ID="Lync" />
      <ExcludeApp ID="OneDrive" />
      <ExcludeApp ID="OneNote" />
      <ExcludeApp ID="Outlook" />
      <ExcludeApp ID="PowerPoint" />
      <ExcludeApp ID="Publisher" />
      <ExcludeApp ID="Teams" />
      <ExcludeApp ID="Word" />
  <Updates Enabled="FALSE" />
  <Display Level="None" AcceptEULA="TRUE" />
  <Property Name="AUTOACTIVATE" Value="1"/>
  <Property Name="FORCEAPPSHUTDOWN" Value="TRUE" />
  <Remove All="TRUE">
answered on Stack Overflow Dec 17, 2020 by Nick Murphy • edited Jan 19, 2021 by Nick Murphy

User contributions licensed under CC BY-SA 3.0