Error while building with MSbee

Topics: For MSBee Users
Aug 17, 2006 at 12:21 AM
migrated from power toy forums
originally posted by Rekha Shinde
------------------------------------------------------

Hi there,

I am getting following error when I try to build a VS 2003 project with Msbee:

***********************************************************************

Target ResolveComReferences:
C:\Program Files\MSBuild\MSBee\RCRFX11.exe wrapperDir:obj\FX11\Debug\ stateFile:obj\FX1_1\Debug\Installer.vbproj.ResolveComReference.cache @"C:\Documents and Settings\Administrator\Local Settings\Temp\2\tmp65D.tmp"
RCRFX1_1 : error : An incorrect number of metadata elements, 50, were retrieved for this TaskItem.
RCRFX1_1 : warning : Type library importer has encountered an interface not derived from IUnknown: _HiddenInterface.
RCRFX1_1 : error : ResolveComReference failed.
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(1364,9): error : "C:\Program Files\MSBuild\MSBee\RCRFX1_1.exe" failed and returned -1.
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(1364,9): error :
Done building target "ResolveComReferences" in project "Installer.vbproj" -- FAILED.

Done building project "Installer.vbproj" -- FAILED.

***************************************************************

Any idea why the build is failing?

Thanks,

-Rekha
Aug 17, 2006 at 12:22 AM
originally posted by DanMoseley
------------------------------------------------------

Rekha,

I can't help with MSBee but if you happen to have a copy of this project upgraded to VS2005 and you get the same problem when you ship with the .NET 2.0 copy of MSBuild.exe, please open a bug at https://connect.microsoft.com/.

Thanks

Dan
Aug 17, 2006 at 12:22 AM
originally posted by John DAddamio - MSFT
------------------------------------------------------

Two questions:

Have you tried building it as an ordinary user rather than running as Administrator?
Have you tried building it with msbuild to verify that there isn't something wrong with the upgrade from VS 2003 to VS 2005? If it doesn't build with the standard msbuild, it probably won't build with MsBee either. I say "probably won't build with MsBee" only because MsBee uses the VS 2003 search order when resolving assembly references. There are some odd scenarios due to the search order and some other minor differences, where something will build with MsBee but not with the standard msbuild or vice versa.
If it builds as an ordinary user, file a bug or let us know by posting here and we'll file it.

If it builds with msbuild, post some more info and I will try to debug the problem for you. The ideal situation would be if you can reproduce the problem in a dummy project that doesn't contain any confidential information or intellectual property. If you can't do that, post info such as how many COM objects you reference, whether they're MSFT's, yours, or a third party's COM objects, etc. If they're all or mostly MSFT's, please list them and I'll see what I can do to help.

John
Aug 17, 2006 at 12:22 AM
originally posted by Rekha Shinde
------------------------------------------------------

Thanks John for the reply.

1. The problem is reproducible even when I try to build as ordinary user. (Not Administrator).

2. The build goes fine with msbuild. It gives the above mentioned error only when tried to build with msbee.

I could reproduce this problem with a sample project. The steps to reproduce are as follows:

1. Create an empty solution (For e.g. TestMsbee ) in VS2003. Add two new empty vb projects to the solution, test1 and test2.

2. Add a COM reference in project test1. I added DSO reference in project test1.

3. Add the same COM reference in project test2. (Again DSO added in project test2).

4. Add test1 project reference in project test2.

In short, test2 project has 2 references, test1 and DSO.

test1 project has only DSO reference.

5. Build the solution (TestMsbee) in VS2003. The build runs successfully.

6. Open the solution (TestMsbee) in VS 2005 and convert it to VS2005 format. Build the solution with msbuild. The build goes fine.

7. Try building the solution with msbee. You will see following errors:

Build FAILED.
RCRFX1_1 : warning : Type library importer has encountered an interface not derived from IUnknown: _HiddenInterface.
RCRFX1_1 : warning : Type library importer has encountered an interface not derived from IUnknown: _HiddenInterface.
RCRFX1_1 : error : An incorrect number of metadata elements, 50, were retrieved for this TaskItem.
RCRFX1_1 : error : ResolveComReference failed.
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(1364,9): error : "C:\Program Files\MSBuild\MSBee\RCRFX1_1.exe" failed and returned -1.
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(1364,9): error :
2 Warning(s)
3 Error(s)

regards,

-Rekha
Aug 17, 2006 at 12:22 AM
originally posted by Bertan Aygun - MSFT
------------------------------------------------------

Rekha,

I was able to reproduce the same behaviour. I am looking in to why it is happening now.

Thanks,

Bertan
Aug 17, 2006 at 12:22 AM
originally posted by Bertan Aygun - MSFT
------------------------------------------------------

The problem is with the delimiter string used in ResolveComReference task. When a project has a com reference and a reference to another project, metadata for referenced project's configuration contains '|' character which was the delimiter.

We are going to schedule time to fix this issue and add a test to MSBee test suite to make sure this scenario is always covered.

Thanks,

Bertan
Aug 17, 2006 at 12:22 AM
originally posted by John DAddamio - MSFT
------------------------------------------------------

Thanks for the great repro case! It allowed us to debug the issue fairly quickly.

As Bertan said, we will fix the problem and incorporate a regression test into the MSBee test suite so that future changes do not break this behavior. One of us will post the release date for the fix as soon as it is ready. We haven't scheduled the work yet so we don't even have a target date as of now.

John
Aug 17, 2006 at 12:23 AM
originally posted by Rekha Shinde
------------------------------------------------------

Thanks guys for the quick response.

-Rekha
Aug 17, 2006 at 12:23 AM
originally posted by John DAddamio - MSFT
------------------------------------------------------

You're welcome!

Out of curiosity, I checked our current test suite to see how we missed hitting this error in our development/testing cycle.

We had a test case that was very similar to your repro case: a solution with 4 trivial projects; a C# console app, a VB console app, a C# DLL, and a VB DLL. Both the DLL projects referenced the same COM object and both console apps referenced both DLL's.

Apparently, the critical difference was that the console apps didn't reference a COM object directly while they were referencing the COM object indirectly through the DLL's.

John
Aug 17, 2006 at 12:23 AM
originally posted by Bertan Aygun - MSFT
------------------------------------------------------

This issue is now fixed with the latest check in to MSBee code. Please download the new source to get the latest version.

Thanks,

Bertan