Build failing with 'Error BE0043: Unexpected error'

Topics: User Forum
Apr 2, 2010 at 8:28 PM

When I attempt to create help documentation using the SHFB I get the following error:

MREFBUILDER : error : Unresolved assembly reference: Microsoft.VisualStudio.TestTools.UITesting (Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a) required by GUI_IE
    Last step completed in 00:00:01.3907
-------------------------------

SHFB: Error BE0043: Unexpected error detected in last build step.  See output above for details.

 

Any ideas on what I'm doing wrong?

 

I have Visual Studio 2010 RC, Sandcastle 2.4.10520.1 and the Sandcastle Help File Builder (1.8.0.3) installed.

I have created coded UI tests and unit tests in VS. My VS project is configured to output an XML file. In my VS project, each of my references is configured with 'Specific Version' set to 'false'.

In my SHFB project, I've added my VS project file as a 'Documentation Source'. Each of the the coded UI and units test libraries reference in VS has been added to my SHFB project 'References' list too.

The full output from the build looks as follows:

-------------------------------
[Sandcastle Help File Builder Utilities, version 1.8.0.3]
Creating output and working folders...
-------------------------------
Clearing working folder...
-------------------------------
Finding tools...
Found Sandcastle tools in 'C:\Program Files\Sandcastle\'
Searching for HTML Help 1 compiler...
Found HTML Help 1 compiler in 'C:\Program Files\HTML Help Workshop\'
-------------------------------
Validating and copying documentation source information
Source: <source directory>\GUI_IE.csproj
    Found project '<source directory>\GUI_IE.csproj'

Parsing project files
    Found assembly '<source directory>\GUI_IE\bin\Debug\GUI_IE.dll'

References to use:
    Microsoft.VisualStudio.QualityTools.CodedUITestFramework
    Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
    Microsoft.VisualStudio.QualityTools.UnitTestFramework
    Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
    Microsoft.VisualStudio.TestTools.UITest.Common
    Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
    Microsoft.VisualStudio.TestTools.UITest.Extension
    Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
    Microsoft.VisualStudio.TestTools.UITesting
    Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
    System
    System.Core
    System.Data
    System.Drawing
    System.Windows.Forms
    UIAutomationTypes
    WindowsBase

Copying XML comments files
    <source directory>\GUI_IE\bin\Debug\GUI_IE.XML -> <shfb project directory>\Doc.Net\Help\Working\GUI_IE.XML
-------------------------------
Generating shared content files (en-US, English (United States))...
    Last step completed in 00:00:00.0156
-------------------------------
Generating API filter for MRefBuilder...
    Last step completed in 00:00:00.0000
-------------------------------
Generating reflection information...
[c:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe]
GenerateRefInfo:
  MrefBuilder (v2.4.10520.1)
  Copyright c Microsoft 2006
  Info: Loaded 1 assemblies for reflection and 7 dependency assemblies.
MREFBUILDER : error : Unresolved assembly reference: Microsoft.VisualStudio.TestTools.UITesting (Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a) required by GUI_IE
    Last step completed in 00:00:01.3907
-------------------------------

SHFB: Error BE0043: Unexpected error detected in last build step.  See output above for details.

Coordinator
Apr 5, 2010 at 12:34 AM

It should automatically resolve the references from the .csproj project file so there's no need to add them as references in the SHFB project.  You should try removing them from there first and letting it resolve the references on its own from the .csproj file first.  In addition, make sure you've downloaded and applied the latest Sandcastle Styles patch which includes the MRefBuilder.exe.config update to support VS 2010 RC.  If any of the assemblies is a .NET 4.0 assembly, it could be missing it if the proper 4.0 framework version isn't being used.

Eric

 

Apr 5, 2010 at 7:48 PM

Thanks for the prompt response.

I removed the redundant references from the SHFB project. I reran the SHFB build. No luck...

I then downloaded the latest Sandcastle styles patch (Sandcastle May 2008 (2.4.10520) Patch - Rev 3) and extracted the zip file to my Sandcastle installation directory (C:\Program Files\Sandcastles) overwriting the existing files. I started SHFB and reran the SHFB build. No luck...

The 'Unresolved assembly reference' is to an assembly installed at 'C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.TestTools.UITesting.dll'. It is not installed under my .Net 4.0.30128 installation.

I was able to get the SHFB build to work once I copied all of the referenced dlls of the ..\bin\debug directory where my VS2010 project dll was compiled. Is there a way to instruct the MSBuild.exe where to look for the dlls? Or something else you might suggest.

Thanks.

 

Coordinator
Apr 5, 2010 at 8:29 PM

It's possible MRefBuilder is having problems resolving to a specific version of the assembly (i.e. one of the other assemblies is already bound to an older or newer version and it finds it first).  Try adding the Assembly Binding Redirection plug-in to the project and redirecting all version of it to the one used by the project.

Eric

 

Apr 5, 2010 at 10:37 PM

There are currently no other versions of the referenced assemblies on the machine.

I've tried using the 'Assembly binding Redirection plug-in' without any luck. On the 'Configure Assembly Binding Redirection Plug-In' screen I configured a redirect as follows:
Binding Redirect:
AssemblyName: Microsoft.VisualStudio.TestTools.UITesting.dll (I also tried specifying the full path)
NewVersion:10.0.0.0
Import:
ConfigurationFile: ..\..\..\..\..\..\..\Program Files\Sandcastle\ProductionTools\MRefBuilder.config

I then clicked 'OK'. When I reopened the binding redirect all of the information entered under 'Binding Redirect' was lost... Also after closing the 'Assembly binding Redirection plug-in', the MRefBuilder.config file was not updated with anything new.

Any idea what I'm doing wrong?

Thanks.

Coordinator
Apr 6, 2010 at 12:53 AM

For the assembly name, you need to specify the name only (no path or extension).  Also, specify a range (OldVersion: 0.0.0.0 and OldVersionTo: 10.0.0.0) and the PublicKeyToken for the assembly.  If not, it won't match it to the entry.  As long as you click OK instead of Cancel, it should save the settings.

Eric

 

Sep 21, 2010 at 9:06 AM

Hi,

I am facing exactly same issue with the same dll (Microsoft.VisualStudio.TestTools.UITesting). Did you get any solution or workaround?

Rajat

Sep 21, 2010 at 1:08 PM

No... I'm afraid not. I have been working on other projects since then and have not be able to get this resolved. Please let me know if you find a solution.

Oct 5, 2010 at 2:58 PM

This sounds pretty similar to the problem I have:

http://shfb.codeplex.com/Thread/View.aspx?ThreadId=226313

I also have a problem with an external assembly. For me its System.Web which is required by another external dll:

MREFBUILDER : error : Unresolved assembly reference: System.Web (System.Web, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a) required by Microsoft.Web.UI.WebControls

ghollingworth wrote:

I was able to get the SHFB build to work once I copied all of the referenced dlls of the ..\bin\debug directory where my VS2010 project dll was compiled.

 

Can you explain this in more detail? Which dlls did you copy where exactly? I'd be happy if I could make it run that way.

Apr 11, 2011 at 5:39 PM

Hi, 

I'm facing this same issue with Microsoft.VisualStudio.TestTools.UITesting.  

MREFBUILDER : error : Unresolved assembly reference: Microsoft.VisualStudio.TestTools.UITesting (Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)

Was this ever solved?

Thanks.

PS: Using SHFB 1.9.3.0.

Coordinator
Apr 11, 2011 at 9:34 PM

I have heard of no solution.  Unfortunately, the assembly in quesion appears to only be part of the Premium and Ultimate versions of Visual Studio to which I do not have access so I cannot test for a solution or workaround.

Eric

 

May 26, 2011 at 4:53 PM

I think what ghollingworth meant was to copy the Microsoft.VisualStudio.TestTools.UITest*. dlls to same (DEBUG) directory where your VS2010 test dll is. This worked for me.

Oct 19, 2011 at 1:49 PM

Just wanted to confirm that I ran into a similar issue where my WP7 shfb project was not compiling. I solved this issue by copying all of the system references (found in C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone) that my WP7 project required into the Bin/Debug (or Bin/Release if compiling in Release mode). In the WP7 shfb project I added a single Documentation Source that pointed to my WP7 assembly (which also brought in my projects xml document file) and everything worked great!

For WP7 Mango, replace the last folder "WindowsPhone" with "WindowsPhone71" to get the Mango system assemblies.

Jan 19, 2015 at 4:38 PM
Edited Jan 19, 2015 at 5:04 PM
Am now having same issue 1/19/2015. Eric may be correct that this assembly is found in Ultimate edition, indeed it is there found under the Private Assemblies path. I don't care for the "put it in the bin directory advice above" yet I created a separate folder and copied all needed assemblies to that location, I then added the references directly to the SHFB project from that folder and am still seeing the same issue. Will investigate and post back.
PrepareForBuild:
  Creating directory &quot;obj\Debug\&quot;.
GenerateRefInfo:
  MRefBuilder (v2015.1.12.0)
  Copyright c 2006-2015, Microsoft Corporation, All Rights Reserved.
  Portions Copyright c 2006-2014, Eric Woodruff, All Rights Reserved.
  Loaded 3 assemblies for reflection and 11 dependency assemblies.
MRefBuilder : error : Unresolved assembly reference: Microsoft.VisualStudio.TestTools.UITest.Playback (Microsoft.VisualStudio.TestTools.UITest.Playback, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a) required by Microsoft.VisualStudio.TestTools.UITesting [C:\Users\SomeUser\Documents\visual studio 2013\Projects\SomeProject\Help\Working\GenerateRefInfo.proj]
    Last step completed in 00:00:00.5859
</buildStep>
<buildStep step="Failed">

SHFB: Error BE0043: Unexpected error detected in last build step.  See output above for details.
   at SandcastleBuilder.Utils.BuildEngine.BuildProcess.RunProcess(String fileToRun, String args)
   at SandcastleBuilder.Utils.BuildEngine.BuildProcess.Build()

</buildStep>
Indeed, placing the dll into the obj/debug folder of SHFB folder allows compile to work. Just adding it as a reference did not help. The default prop. of Copy Local was set to true when adding as reference....
Coordinator
Jan 19, 2015 at 5:45 PM
You should be able to resolve this issue now using the Assembly Binding Redirection plug-in. It has an option to ignore certain assemblies if they cannot be found such as this one. You'd just add the "Microsoft.VisualStudio.TestTools.UITest.Playback" name to the list of "Ignore if Unresolved" assembly IDs. The build will complete, you just won't get any inherited member info for classes in the named assemblies. Typically that isn't a big deal since they're either design or test related..

Eric