none
How to install shdocvw.dll into Container? RRS feed

  • Question

  • I have a C# project with following reference:

    SHDocVw
    Name: Interop.SHDocVw 
    Path: C:\Work\ABC\obj\x86\Release\Interop.SHDocVw.dll

    I think that Interop.SHDocVw.dll is generated from shdocvw.dll and copied to the "Path".

    There is no shdocvw.dll in container under C:\Windows\SysWOW64 and C:\Windows\SysWOW64.\

    So compiling the project in windowsserercore now reports following error.

    error CS0246: The type or namespace name 'SHDocVw' could not be found (are you missing a using directive or an assembly reference?)

    Is there any workload I can stall for the container to resolve this? Any workaround that might work? Thanks.


    Wednesday, August 21, 2019 9:11 AM

Answers


  • I resolved the problem myself.

    Copy a SHDocVw.dll from "C:\Windows\System32" to the project folder and add a new com reference in the project file using <COMFileReference>.

    <ItemGroup>

    <!-- <COMReference Include="SHDocVw">
    <Guid>{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}</Guid>
    <VersionMajor>1</VersionMajor>
    <VersionMinor>1</VersionMinor>
    <Lcid>0</Lcid>
    <WrapperTool>tlbimp</WrapperTool>
    <Isolated>False</Isolated>
    <EmbedInteropTypes>True</EmbedInteropTypes>
    </COMReference> -->
    <COMFileReference Include="SHDocVw.dll">
    <EmbedInteropTypes>True</EmbedInteropTypes>
    <HintPath>.\</HintPath>
    </COMFileReference>

    </ItemGroup>

    • Marked as answer by LiangMing2003 Tuesday, August 27, 2019 12:58 AM
    Tuesday, August 27, 2019 12:58 AM

All replies

  • I suggest deleting the existing reference and adding a new one. I see SHDocVw in my C:\Windows\System32 and that is likely the one you want.


    Sam Hobbs
    SimpleSamples.Info

    Wednesday, August 21, 2019 7:10 PM
  • Thanks, but in Windows container windowsservercore, there is no shdocvw.dll in under C:\Windows\SysWOW64 and C:\Windows\SysWOW64\.

    Anyone knows the workload ID of  VS 2017 Build tools that included shdocvw.dll? 

    Thursday, August 22, 2019 6:39 AM
  • SHDocVw.dll is not a build tool. It is part of Windows. It has parts of Internet Explorer and parts of the Windows Shell; you can say it has parts of the Files Explorer.



    Sam Hobbs
    SimpleSamples.Info

    Thursday, August 22, 2019 7:30 AM
  • COPY ./shdocvw/System32/shdocvw.dll "c:/windows/System32/"

    COPY ./shdocvw/SysWOW64/shdocvw.dll "c:/windows/SysWOW64/"

    SHELL ["cmd", "/S", "/C" ]

    RUN c:\windows\System32\regsvr32.exe c:\windows\System32\shdocvw.dll //a hang happens here

    RUN c:\windows\SysWOW64\regsvr32.exe c:\windows\SysWOW64\shdocvw.dll

    SHELL ["powershell", "-NoProfile", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue'; "]

    above is the code to copy and registry shdocvw.dll in container building process.

    Anyone knows why there is a hang? Thanks.

    Thursday, August 22, 2019 8:46 AM

  • I resolved the problem myself.

    Copy a SHDocVw.dll from "C:\Windows\System32" to the project folder and add a new com reference in the project file using <COMFileReference>.

    <ItemGroup>

    <!-- <COMReference Include="SHDocVw">
    <Guid>{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}</Guid>
    <VersionMajor>1</VersionMajor>
    <VersionMinor>1</VersionMinor>
    <Lcid>0</Lcid>
    <WrapperTool>tlbimp</WrapperTool>
    <Isolated>False</Isolated>
    <EmbedInteropTypes>True</EmbedInteropTypes>
    </COMReference> -->
    <COMFileReference Include="SHDocVw.dll">
    <EmbedInteropTypes>True</EmbedInteropTypes>
    <HintPath>.\</HintPath>
    </COMFileReference>

    </ItemGroup>

    • Marked as answer by LiangMing2003 Tuesday, August 27, 2019 12:58 AM
    Tuesday, August 27, 2019 12:58 AM