Step 2 failure (MRefBuilder)

Topics: General Questions
Jul 16, 2010 at 10:22 AM

OS: Windows 7 ultimate

DocProject: 1.11.0 Release Candidate

Sandcastle: Latest (though I get same error with May 2008 Release)

Visual Studio 2008: 9.0.30729.1 SP

I am administrator on my machine.

UAC on or off make no difference.

Sandcastle seem ok (at least when I use Sandcastle GUI in %DXROOT%\Examples\Generic).

Build fails in Visual Studio as well as in DocProject external UI.

VS solution consist of a .net 2.0 targeted Windows Form application project created
by wizard, with non used references removed (System.Collection.Generics etc.), and
a DocProject with a reference added to the project.

Debug/Release make no difference.

Output:

------ Rebuild All started: Project: WindowsFormsApplication1, Configuration: Release Any CPU ------
Build started 2010-07-16 11:04:05.
Target CoreClean:
    Deleting file "C:\Users\Malmberg\Documents\Visual Studio 2008\Projects\WindowsFormsApplication1\bin\Release\WindowsFormsApplication1.exe".
    Deleting file "C:\Users\Malmberg\Documents\Visual Studio 2008\Projects\WindowsFormsApplication1\bin\Release\WindowsFormsApplication1.pdb".
    Deleting file "C:\Users\Malmberg\Documents\Visual Studio 2008\Projects\WindowsFormsApplication1\obj\Release\WindowsFormsApplication1.Properties.Resources.resources".
    Deleting file "C:\Users\Malmberg\Documents\Visual Studio 2008\Projects\WindowsFormsApplication1\obj\Release\WindowsFormsApplication1.csproj.GenerateResource.Cache".
    Deleting file "C:\Users\Malmberg\Documents\Visual Studio 2008\Projects\WindowsFormsApplication1\obj\Release\WindowsFormsApplication1.exe".
    Deleting file "C:\Users\Malmberg\Documents\Visual Studio 2008\Projects\WindowsFormsApplication1\obj\Release\WindowsFormsApplication1.pdb".
Target CoreResGen:
    Processing resource file "Properties\Resources.resx" into "obj\Release\WindowsFormsApplication1.Properties.Resources.resources".
Target CoreCompile:
    C:\Windows\Microsoft.NET\Framework\v3.5\Csc.exe /noconfig /nowarn:1701,1702 /errorreport:prompt /warn:4 /define:TRACE /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll /debug:pdbonly /filealign:512 /optimize+ /out:obj\Release\WindowsFormsApplication1.exe /resource:obj\Release\WindowsFormsApplication1.Properties.Resources.resources /target:winexe Form1.cs Form1.Designer.cs Program.cs Properties\AssemblyInfo.cs Properties\Resources.Designer.cs Properties\Settings.Designer.cs

Compile complete -- 0 errors, 0 warnings
Target CopyFilesToOutputDirectory:
    Copying file from "obj\Release\WindowsFormsApplication1.exe" to "bin\Release\WindowsFormsApplication1.exe".
    WindowsFormsApplication1 -> C:\Users\Malmberg\Documents\Visual Studio 2008\Projects\WindowsFormsApplication1\bin\Release\WindowsFormsApplication1.exe
    Copying file from "obj\Release\WindowsFormsApplication1.pdb" to "bin\Release\WindowsFormsApplication1.pdb".

Build succeeded.

Time Elapsed 00:00:00.31
------ Rebuild All started: Project: DocProject1, Configuration: Release Any CPU ------
Build started 2010-07-16 11:04:05.
Target CoreClean:
    Deleting file "C:\Users\Malmberg\Documents\Visual Studio 2008\Projects\DocProject1\bin\Release\DocProject1.dll".
    Deleting file "C:\Users\Malmberg\Documents\Visual Studio 2008\Projects\DocProject1\bin\Release\DocProject1.pdb".
    Deleting file "C:\Users\Malmberg\Documents\Visual Studio 2008\Projects\DocProject1\bin\Release\WindowsFormsApplication1.exe".
    Deleting file "C:\Users\Malmberg\Documents\Visual Studio 2008\Projects\DocProject1\bin\Release\WindowsFormsApplication1.pdb".
    Deleting file "C:\Users\Malmberg\Documents\Visual Studio 2008\Projects\DocProject1\obj\Release\ResolveAssemblyReference.cache".
    Deleting file "C:\Users\Malmberg\Documents\Visual Studio 2008\Projects\DocProject1\obj\Release\DocProject1.dll".
    Deleting file "C:\Users\Malmberg\Documents\Visual Studio 2008\Projects\DocProject1\obj\Release\DocProject1.pdb".
Target ResolveProjectReferences:
Target CoreCompile:
    C:\Windows\Microsoft.NET\Framework\v3.5\Csc.exe /noconfig /nowarn:1701,1702 /errorreport:prompt /warn:4 /define:TRACE /reference:C:\Windows\assembly\GAC_MSIL\DaveSexton.DocProject\1.11.0.0__af1a4bab65cc4ece\DaveSexton.DocProject.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll /reference:"C:\Users\Malmberg\Documents\Visual Studio 2008\Projects\WindowsFormsApplication1\bin\Release\WindowsFormsApplication1.exe" /debug:pdbonly /optimize+ /out:obj\Release\DocProject1.dll /target:library BuildProcess.cs Properties\AssemblyInfo.cs

Compile complete -- 0 errors, 0 warnings
Target _CopyFilesMarkedCopyLocal:
    Copying file from "C:\Users\Malmberg\Documents\Visual Studio 2008\Projects\WindowsFormsApplication1\bin\Release\WindowsFormsApplication1.exe" to "bin\Release\WindowsFormsApplication1.exe".
    Copying file from "C:\Users\Malmberg\Documents\Visual Studio 2008\Projects\WindowsFormsApplication1\bin\Release\WindowsFormsApplication1.pdb" to "bin\Release\WindowsFormsApplication1.pdb".
Target GetCopyToOutputDirectoryItems:
Target CopyFilesToOutputDirectory:
    Copying file from "obj\Release\DocProject1.dll" to "bin\Release\DocProject1.dll".
    DocProject1 -> C:\Users\Malmberg\Documents\Visual Studio 2008\Projects\DocProject1\bin\Release\DocProject1.dll
    Copying file from "obj\Release\DocProject1.pdb" to "bin\Release\DocProject1.pdb".

Starting help build for DocProject1...
Preparing target directory...
Merging XML documentation for WindowsFormsApplication1.exe...
Building documentation for DocProject1...

Step 1 of 12: Change Directory

Changing current directory from "C:\Users\Malmberg\Documents\Visual Studio 2008\Projects\DocProject1\Help\" to "C:\Users\Malmberg\Documents\Visual Studio 2008\Projects\DocProject1\buildhelp"

Step 1 Time Elapsed: 00:00:00

Step 2 of 12: Execute MRefBuilder

C:\Sandcastle\ProductionTools\MRefBuilder /config:"C:\Users\Malmberg\Documents\Visual Studio 2008\Projects\DocProject1\Help\Presentation\Style\Configuration\MRefBuilder.config" /out:reflection.org /internal- /dep:"C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll","C:\Windows\assembly\GAC_MSIL\System.Windows.Forms\2.0.0.0__b77a5c561934e089\System.Windows.Forms.dll","C:\Windows\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll","C:\Windows\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll","C:\Windows\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll","C:\Windows\assembly\GAC_MSIL\System.Data.SqlXml\2.0.0.0__b77a5c561934e089\System.Data.SqlXml.dll","C:\Windows\assembly\GAC_MSIL\System.Security\2.0.0.0__b03f5f7f11d50a3a\System.Security.dll","C:\Windows\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll","C:\Windows\assembly\GAC_MSIL\Accessibility\2.0.0.0__b03f5f7f11d50a3a\Accessibility.dll","C:\Windows\assembly\GAC_MSIL\System.Runtime.Serialization.Formatters.Soap\2.0.0.0__b03f5f7f11d50a3a\System.Runtime.Serialization.Formatters.Soap.dll","C:\Windows\assembly\GAC_MSIL\System.Deployment\2.0.0.0__b03f5f7f11d50a3a\System.Deployment.dll" "C:\Users\Malmberg\Documents\Visual Studio 2008\Projects\WindowsFormsApplication1\bin\Release\WindowsFormsApplication1.exe"

MrefBuilder (v2.6.10621.1)
Copyright ¸ Microsoft 2006
Error: A file access error occured while attempting to load the addin assembly 'C:\Users\Malmberg\Documents\Visual Studio 2008\Projects\DocProject1\Help\Presentation\Style\Configuration\MRefBuilder.exe'. The error message is: Could not load file or assembly 'file:///C:\Users\Malmberg\Documents\Visual Studio 2008\Projects\DocProject1\Help\Presentation\Style\Configuration\MRefBuilder.exe' or one of its dependencies. The system cannot find the file specified.
Non-zero exit code: 1

Step 2 DaveSexton.DocProject.Engine.ExternalProcessException: Execute MRefBuilder:
The "C:\Sandcastle\ProductionTools\MRefBuilder" process failed with exit code: 1.
 
Successful Steps: 1 of 12
Failed Steps: 1

DocProject1 help build failed.



Total Time Elapsed: 00:00:00.7340507
Build FAILED.

Time Elapsed 00:00:01.71
========== Rebuild All: 1 succeeded, 1 failed, 0 skipped ==========

 

Apologies if this is a trivial question ... thanks for any help!

Jul 16, 2010 at 3:41 PM

Hi,

Did you create your DocProject against the latest version of Sandcastle and then install the older version of Sandcastle?  If so, try creating a new DocProject against the older version of Sandcastle now that it's installed.

- Dave

Jul 19, 2010 at 8:15 AM

Hi, thanks for quick reply, but sorry, what I've done is install Sancastle (May 2008), install DocProject, create new DocProject and get failure in step 2. Then I uninstalled everything, thought Sandcastle was too complex to use by itself, but then I read about the Sandcastle GUI and wanted to check it out so I installed the latest one and used it for a while.

 

Then for some reason I played around with Team Build Service and wanted to try DocProject again, so I installed it again and created a new DocProject but I get the same result.

 

I don't know if it is worth mentioning I made one early attempt with Sandcastle alone and installed it in default location (C:\Program Files\...) but since Sandcastle (at least in default configuration, as far as I can tell) writes to Program Files, that is a no-no in Windows 7, as you might know, so Sandcastle is not in a default location.

Thanks anyway :-) It ain't that important for me although I really could use it!

Jul 19, 2010 at 9:18 AM

Hi,

DocProject doesn't support the latest release of Sandcastle yet (it's a work in progress).  To use the Sandcastle May 2008 release you must have the DXROOT environment variable pointing to the
correct location.  It's configured by Sandcastle's installer, not DocProject's.

The simplest solution is probably to uninstall Sandcastle and DocProject.  Ensure that both installation directories are entirely removed.  Then install the May 2008 release of Sandcastle
followed by DocProject 1.11.0.  You may also have to restart your computer.

Note that if you've installed a VS SDK, then you'll need to delete the DXROOT user environment variable since it's pointing to the wrong Sandcastle path.  Check to make sure the DXROOT system environment variable is correct.  Reboot.

- Dave

Jul 19, 2010 at 10:14 AM

Hello, thank you for your support, I tried once more and for some reason now it worked. I don't know why though, sorry ...

 

Thanks a lot!

Oct 13, 2010 at 9:28 PM

I am getting the same error. First I had the latest Sandcastle release installed + latest shfb + latest DocProject. After reading this, I uninstalled everything, checked to see whether the Program Files dirs were completely removed, downloaded the May 2008 release of Sandcastle, and finally the DocProject 1.11.0. I even rebooted my PC, and checked to verfy there is no 'user environment variable' called DXROOT...

But I still get the error... any ideas ? Am I doing something wrong ?

MrefBuilder (v2.4.10520.1)
Copyright ¸ Microsoft 2006
Error: A file access error occured while attempting to load the addin assembly 'D:\svn\ChildBenefit\Trunk\ChildBenefit2005\OfficeCapture\Help\Presentation\Style\Configuration\MRefBuilder.exe'. The error message is: Could not load file or assembly 'file:///D:\svn\ChildBenefit\Trunk\ChildBenefit2005\OfficeCapture\Help\Presentation\Style\Configuration\MRefBuilder.exe' or one of its dependencies. The system cannot find the file specified.

Step 2 DaveSexton.DocProject.Engine.ExternalProcessException: Execute MRefBuilder:
The "C:\Program Files\Sandcastle\ProductionTools\MRefBuilder" process failed with exit code: 1.
Oct 19, 2010 at 5:56 PM

Hi,

Have you applied the latest Sandcastle Styles patch?  It's not supported yet since DocProject is not yet compatible with the latest release of Sandcastle.

If you have, then please reinstall Sandcastle without applying the Sandcastle Styles patch.

- Dave

Jan 3, 2011 at 7:35 PM

I did not install the styles patch but was still getting this error. So I uninstalled Sandcastle and DocProject, made sure the directories were completely gone, reinstalled them, and I'm still getting the MRefBuilder error.

This is in VS 2008.

Jan 4, 2011 at 1:06 PM

Hi,

You're getting the exact same error?

MrefBuilder (v2.6.10621.1)
Copyright ¸ Microsoft 2006
Error: A file access error occured while attempting to load the addin assembly '{DocProjectPath}\Help\Presentation\Style\Configuration\MRefBuilder.exe'.
The error message is: Could not load file or assembly 'file:///{DocProjectPath}\Help\Presentation\Style\Configuration\MRefBuilder.exe' or one of its dependencies.
The system cannot find the file specified.
Non-zero exit code: 1

You do not have the latest version of Sandcastle installed?
You do not have the latest version of the Sandcastle Styles patch installed?
You do have DocProject 1.11.0 installed?
There's only one DXROOT environment variable on your system and it points to C:\Program Files\Sandcastle, or wherever you had installed Sandcastle when you downloaded it?

--

Frankly, I've never seen this issue before.  It's originating from MRefBuilder though, which is a Sandcastle tool.  The MRefBuilder.config file is the only thing I can think of that may be related.

DocProject imports the MRefBuilder.config file into new projects under the folder: Help\Presentation\Style\Configuration.

I guess the next step would be to check in that file to see if you can find anything about "add-ins" that may be causing this error.

- Dave

Jan 4, 2011 at 5:26 PM

I have DocProject 1.11.0 installed and the May 2008 version of Sandcastle installed. That's it. No style patches, etc. With Visual Studio 2008. This was a brand new installation of all software as my laptop was replaced by the IT guys last week.

DXROOT points to C:\Program Files (x86)\Sandcastle\ which is correct.

The version of MrefBuilder referenced is not v2.6.10621.1.

Here's my error message:

MrefBuilder (v2.4.10520.1)
Copyright c Microsoft 2006
Error: A file access error occured while attempting to load the addin assembly 'C:\SRC\Benu\Trunk\BenuWcfService\BenuHelp\BenuHelp\Help\Presentation\Style\Configuration\MRefBuilder.exe'.
The error message is: Could not load file or assembly 'file:///C:\SRC\Benu\Trunk\BenuWcfService\BenuHelp\BenuHelp\Help\Presentation\Style\Configuration\MRefBuilder.exe' or one of its dependencies.
The system cannot find the file specified.

Step 2 DaveSexton.DocProject.Engine.ExternalProcessException: Execute MRefBuilder:
The "C:\Program Files (x86)\Sandcastle\ProductionTools\MRefBuilder" process failed with exit code: 1.

Jan 4, 2011 at 5:31 PM

Okay, looking back at the instructions for DXROOT, it says to delete the user variable and make sure the system variable points to the correction location. I see two user variables under TEMP and TMP but don't see a separate system variable, only the user variable. This is in Win7

Jan 4, 2011 at 5:59 PM
Edited Jan 4, 2011 at 6:00 PM

Hi,

The DXROOT instructions only apply if you've installed the Visual Studio SDK, because it also installs an older version of Sandcastle.

Did you take a look at the MRefBuilder.config file?  Does it have anything suspicious in it, such as an <addIn> element that's uncommented?

- Dave

Jan 4, 2011 at 6:22 PM
Edited Jan 4, 2011 at 10:46 PM

The only addin shown in the config file is this:

    <addins>
      <addin type="Microsoft.Ddue.Tools.XamlAttachedMembersAddIn" assembly="MRefBuilder.exe" />
    </addins>

Jan 4, 2011 at 8:29 PM

Hi,

Trying commenting that out.  If I get a chance later today I'll use Reflector to see if I can find out why MRefBuilder.exe is failing.  At this point, I don't see how DocProject could be related since it doesn't even modify the addins section at all.

- Dave

Jan 4, 2011 at 10:48 PM

No, error still displays.

In the config file, it has this:

<resolver type="Microsoft.Ddue.Tools.Reflection.AssemblyResolver" assembly="%DXROOT%\ProductionTools\MRefBuilder.exe" use-gac="false" />

Could that be where it is coming from?

Jan 4, 2011 at 11:13 PM

I thought these threads may explain my problem since we're using .NET 4 but still getting the error.

http://sandcastle.codeplex.com/Thread/View.aspx?ThreadId=70373
http://sandcastle.codeplex.com/Thread/View.aspx?ThreadId=212543

Not sure how this works, but it looks like it is trying to open the MRefBuilder.exe file in the project folder and not in the sandcastle folder and since the exe file isn't there, it fails.

Error: A file access error occured while attempting to load the addin assembly 'C:\SRC\Benu\Trunk\BenuWcfService\BenuHelp\BenuHelp\Help\Presentation\Style\Configuration\MRefBuilder.exe'.
The error message is: Could not load file or assembly 'file:///C:\SRC\Benu\Trunk\BenuWcfService\BenuHelp\BenuHelp\Help\Presentation\Style\Configuration\MRefBuilder.exe' or one of its dependencies.
The system cannot find the file specified.

Jan 4, 2011 at 11:33 PM
Edited Jan 4, 2011 at 11:34 PM

Aha! Found this thread: http://sandcastle.codeplex.com/Thread/View.aspx?ThreadId=24364 where it says that "some of the Sandcastle components rely on DXRoot implicitly (meaning in such a way that a path can't be fed in externally)"

So, I went into the config files in my help solution and in the sandcastle folder and added the full pathname to the exe file:

<resolver type="Microsoft.Ddue.Tools.Reflection.AssemblyResolver" assembly="C:\Program Files (x86)\Sandcastle\ProductionTools\MRefBuilder.exe" use-gac="false" />

<addin type="Microsoft.Ddue.Tools.ExtensionMethodAddIn" assembly="C:\Program Files (x86)\Sandcastle\ProductionTools\MRefBuilder.exe" />

And it built perfectly. I now have a usable CHM file.

Jan 4, 2011 at 11:50 PM

Hi,

Great news, thanks for following up.

Now for the real question: Why doesn't DocProject always fail because of this problem?

I hope that MS didn't re-release a new version of Sandcastle May 2008 that breaks DocProject  :P

- Dave

Jan 28, 2011 at 11:01 AM

Hi

Had the same problem with the 2008 build of sandcastle. Starting the standalone version of DocProject shed some more light on what was going wrong:

It tried to start MrefBuilder from somewhere unerneath the documentation project (partial p.ath show below).

<project>\Docs\Help\Presentation\Style\Configuration

I solved this quick and dirty by copying the whole '<progfiles>\Sandcastle\ProductionTools' directory content into above directory.

It's clear some paths get screwed up terribly. Time to download some sources...

wvd_vegt

 

Nov 28, 2011 at 3:16 PM

On Windows 7 64 Bit Professional the problem seems still there.

In the Projects MRefBuilder.config I changed

<addin type="Microsoft.Ddue.Tools.ExtensionMethodAddIn" assembly="MRefBuilder.exe" />

to

<addin type="Microsoft.Ddue.Tools.ExtensionMethodAddIn" assembly="%DXROOT%\ProductionTools\MRefBuilder.exe" />

Now _this_ build step succeeds, but the complete VS 2008 (Professional SP1) crashes. I'm still working on this item.

The event viewer says:

An unhandled exception has occurred in the build assembler AppDomain. Terminating: True. System.IO.FileLoadException: Die Datei oder Assembly "BuildAssemblerLibrary, Version=2.4.10520.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35" oder eine Abhängigkeit davon wurde nicht gefunden. Die gefundene Manifestdefinition der Assembly stimmt nicht mit dem Assemblyverweis überein. (Ausnahme von HRESULT: 0x80131040) Dateiname: "BuildAssemblerLibrary, Version=2.4.10520.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35" bei DaveSexton.DocProject.Sandcastle.BuildAssemblerStep.BuildAssemblerController.ExecuteAssembler(Object state) bei System.Threading.ThreadHelper.ThreadStart_Context(Object state) bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) bei System.Threading.ThreadHelper.ThreadStart(Object obj)

Anyone knowing this problem?