1

I'm using Visual Studio Team Services to automate the Build of my C# / VB.Net solution.

In one of the Projects we've made use of the Mobile Broadband API. The Solution / Project builds without any issues when done from my local development machine but when it comes to automating the build in VSTS, there is a build error in the Project that uses the MbnAPI. Some details in the VSTS build logs are:

Cannot get the file path for type library "dcbbbab6-0001-4bbb-aaee-338e368af6fa" version 1.0. Library not registered.

Warning BC40056: Namespace or type specified in the Imports 'MbnApi' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.

This error was thrown on both a cloud-hosted build server and an in-house custom build server.

This MbnAPI dll wasn't added to the project via NuGet as it isn't available via these means. I thought the problem was due to it's "Embed Interop Types" Property in the Project being set to "True" so tried changing it to "False" and "Copy Local" to "True" but it didn't make any difference.

Has anyone got any ideas to fix this VSTS build error?

Thanks in advance

Stu1986C
  • 1,452
  • 1
  • 18
  • 34
  • 1
    I can't reproduce this issue on a private agent (hosted agent doesn't work fine), my steps: 1. Add mbnapi.tlb reference 2. Add a simple code (`MbnApi.MbnConnectionManager m = new MbnApi.MbnConnectionManager();`) Can you share a simple project on the OneDrive? – starian chen-MSFT May 02 '18 at 02:40
  • I'll try this out and let you know @starianchen-MSFT. Thanks – Stu1986C May 02 '18 at 09:29
  • I've managed to get a successful Build on VSTS now by editing the .csproj and swapping the `comreference` for a `comfilereference` as per this [solution](https://stackoverflow.com/questions/8842742/how-can-c-sharp-use-a-legacy-dll-simply-without-registrationregsvr32). Still a bit messy though. I'm going to keep looking for a better solution – Stu1986C May 02 '18 at 13:29
  • Thanks @starianchen-MSFT. At the moment, I'm not happy with the solution I have and wouldn't recommend it to anyone :p I'll post my answer when my solution is a little more reliable :) – Stu1986C May 03 '18 at 08:22
  • You may share a simple project on the OneDrive. – starian chen-MSFT May 03 '18 at 08:34
  • Have you tried to install it on your local build server? – Rodrigo Werlang May 03 '18 at 16:15

0 Answers0