none
MSB3287: Cannot load type library for reference "XY". Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))

    Question

  • Hi,

    I am trying to move a small C# (V.Net 2.0) to a build server and so am trying to get the build to work using msbuild.

    The problem is, that one DLL which is referenced by the project is not correctly included when building with msbuild.
    The error/warning message is:
    Target ResolveComReferences:
                C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets : warning MSB3287: Cannot load type library for reference "ACRODISTXLib". Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))


    Looking at the csc.exe call, I can see that it is missing the following:
    /reference:obj\Release\Interop.ACRODISTXLib.dll
    in its arguments.
    This argument is present in the csc.exe call from within Visual Studio.

    The dll can be found in the projects csproj file:
    ...
    <ItemGroup>
        <COMReference Include="ACRODISTXLib">
          <Guid>{317DA881-ECC5-11D1-B976-00600802DB86}</Guid>
          <VersionMajor>1</VersionMajor>
          <VersionMinor>0</VersionMinor>
          <Lcid>0</Lcid>
          <WrapperTool>tlbimp</WrapperTool>
          <Isolated>False</Isolated>
        </COMReference>
    ...

    What could be the reason that msbuild is missing this reference? (While the VisualStudio build is not?)
    Is there a way to manually add it via an argument passt to msbuild (I was not able to get it out of the doc).

    Kind regards!


    ____ Happens
    Thursday, October 30, 2008 4:05 PM

Answers

  • Hello,

    It is possible that on the build machine Visual Studio doesn't have the dll on the Reference Path. One way to address this is to create a solution folder (e.g. ExternalDLLs), add your dll in the ExternalDLLs folder and then reference this dll instance. When the build machine will get the source code, will also get the dll and correctly reference it.

    Thanks,
    Alin
    TFS Consultant/Build Automation

    Friday, October 31, 2008 4:47 AM
  • Hi, thanks for your answer!

    I also tried it yesterday, but missed removing the ComReference entry in the csproj file (so the warning still showed up).
    I also wasn't sure if it was the correct approach, but with your answer I had a look at it this morning again and got it to work.

    So now I added:
    ...
    <Reference Include="Interop.ACRODISTXLib" />
    ...
    ...
    <Content Include="DLLs\Interop.ACRODISTXLib.dll" />
    ...

    And removed the complete <COMReference Include="ACRODISTXLib"> entry.
    And then it seems to work.
    So thanks for the solution!
    I guess the COMReference is resolved by looking at the system and finding an installation/provider for the dll?

    Kind regards!




    ____ Happens
    • Marked as answer by DarkTrooper Friday, October 31, 2008 7:55 AM
    Friday, October 31, 2008 7:54 AM

All replies

  • Hello,

    It is possible that on the build machine Visual Studio doesn't have the dll on the Reference Path. One way to address this is to create a solution folder (e.g. ExternalDLLs), add your dll in the ExternalDLLs folder and then reference this dll instance. When the build machine will get the source code, will also get the dll and correctly reference it.

    Thanks,
    Alin
    TFS Consultant/Build Automation

    Friday, October 31, 2008 4:47 AM
  • Hi, thanks for your answer!

    I also tried it yesterday, but missed removing the ComReference entry in the csproj file (so the warning still showed up).
    I also wasn't sure if it was the correct approach, but with your answer I had a look at it this morning again and got it to work.

    So now I added:
    ...
    <Reference Include="Interop.ACRODISTXLib" />
    ...
    ...
    <Content Include="DLLs\Interop.ACRODISTXLib.dll" />
    ...

    And removed the complete <COMReference Include="ACRODISTXLib"> entry.
    And then it seems to work.
    So thanks for the solution!
    I guess the COMReference is resolved by looking at the system and finding an installation/provider for the dll?

    Kind regards!




    ____ Happens
    • Marked as answer by DarkTrooper Friday, October 31, 2008 7:55 AM
    Friday, October 31, 2008 7:54 AM