Still works in .NET 4.0 beta 2.

Jan 20, 2010 at 12:27 PM

I tried it yesterday, and it still works for .NET 4.0 Assemblies even that Sandcastle and SHFB is running in the 2.0 CLR, but not without some tweaking:

How to make it work: 
Copy all referenced assemblies to the same folder, including the 4.0 System assemblies. Then it compiles and the files are generated.

- Rune
http://enyosoft.com

Jan 31, 2010 at 5:12 PM

A somewhat easier solution, which is working fine for me, is to edit the .shfb file manually and change the ToolsVersion attribute of the root element to "4.0". Looking at the source for the program, it seems to already have the capability for handling .NET 4.0 projects.

Thanks to EWoodruff not only for creating a great UI but for already integrating (at least partial) .NET 4.0 support.

Feb 26, 2010 at 8:15 PM

I'm trying with a .NET 4.0 RC assembly and I'm not having much luck. I tried changing the ToolsVersion in the shfbproj file, but I still get the same errors. I get unresolved assembly references even for assemblies I explicitly add references for. If I add them as documentation sources, I get a farther but I have to enter every single Framework dependency and, ultimately, it crashing trying to resolve a reference.

Coordinator
Feb 27, 2010 at 2:11 AM
Edited Feb 28, 2010 at 5:55 PM

Have you applied the latest Sandcastle Styles patch which includes the required MRefBuilder.exe.config that lets MRefBuilder parse .NET 4.0 assemblies?  It will need updating to include the latest version number that comes with VS2010 Release Candidate.

Eric

Mar 1, 2010 at 11:30 AM

Hi,

I'm having a similar problem as jimlamb. For a .NET 4.0 (RC) project, I'm getting the following error:

MREFBUILDER : error : Unresolved assembly reference: System.Core (System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)

The most recent version of Sandcastle Styles is installed (May 2008 Patch Rev 3).  Any idea how to work around this problem?

Thanks,

Marcus

Coordinator
Mar 1, 2010 at 5:38 PM

You'll need to update the MRefBuilder.exe.config to include the RC version of the .NET 4.0 framework.  Once done, it should work:

<supportedRuntime version="v4.0.30128"/> <!-- 4.0 RC installed by VS2010 RC -->

Eric

 

Mar 2, 2010 at 6:01 AM

Thanks Eric! Worked perfectly.

Note to others - Make sure you edit the file as administrator on Windows 7 (maybe also Vista) or the file gets moved into the virtual store and you may have problems. I did, but just had to copy it back as administrator.

Mar 2, 2010 at 3:17 PM

I applied the Sandcastle May 2008 (2.4.10520) Patch - Rev 3 to my existing installation and updated the MRefBuild.exe.config to include the RC version of the .NET 4.0 framework. My documentation project still isn't building successfully, however.

Generating reflection information...
[C:\Windows\Microsoft.NET\Framework64\v3.5\MSBuild.exe]
GenerateRefInfo:
  MrefBuilder (v2.4.10520.1)
  Copyright c Microsoft 2006
  Unknown target platform version '4.0'.
C:\Users\JimLamb\Sources\TfsSdk\Solutions\ExtendingTeamProjects\#\Help\Working\GenerateRefInfo.proj(35,5): error MSB6006: "MRefBuilder.exe" exited with code 1.
    Last step completed in 00:00:05.1070
-------------------------------

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

Coordinator
Mar 2, 2010 at 3:36 PM

You appear to be using an older version of SHFB which doesn't properly support .NET 4.0.  Upgrade to v1.8.0.3 which contains support for .NET 4.0.

Eric

 

Mar 2, 2010 at 3:51 PM

According to the About box, I am running 1.8.0.3.

Coordinator
Mar 3, 2010 at 2:20 AM

If you check the MRefBuilder.config file in the working folder after the build fails you should see the platform element with the version attribute set to 4.0.  That's the cause of the error.  If that's the case, the build is running using an older version of SHFB.  You might check your SHFBROOT environment variable to make sure it isn't pointing to an outdated version.  If you're running Vista or Windows 7 and have modified any of the SHFB template files, you might check to be sure that a virtualized copy of an older version isn't hanging around and thus overriding the newer files.

Eric

 

Mar 3, 2010 at 6:12 PM

Here's the first part of the MRefBuilder.config file in my Working directory:

<configuration>
  <dduetools>
    <!--<platform version="2.0" path="%SystemRoot%\Microsoft.NET\Framework\v2.0.50727\" />-->
    <platform version="4.0" path="%SystemRoot%\Microsoft.NET\Framework\v4.0.30128\" />
    <resolver type="Microsoft.Ddue.Tools.Reflection.AssemblyResolver" assembly="C:\Program Files (x86)\Sandcastle\ProductionTools\MRefBuilder.exe" use-gac="false" />
    <addins>
      <addin type="Microsoft.Ddue.Tools.ExtensionMethodAddIn" assembly="C:\Program Files (x86)\Sandcastle\ProductionTools\MRefBuilder.exe" />
      <addin type="Microsoft.Ddue.Tools.XamlAttachedMembersAddIn" assembly="C:\Program Files (x86)\Sandcastle\ProductionTools\MRefBuilder.exe" />
    </addins>
    <attributeFilter expose="true">
      <!-- Most attributes in System.ComponentModel control designer behavior. Don't show them. -->
      <!-- The exceptions are attributes relating to data binding. Do show them. -->
      <namespace name="System.ComponentModel" expose="false">

The environment variable is set as follows:
SHFBROOT=C:\Program Files (x86)\EWSoftware\Sandcastle Help File Builder\ 

I'm going to try uninstalling SHFB and Sandcastle, manually removing anything left and re-installing.

Mar 3, 2010 at 6:43 PM

I uninstalled SHFB and Sandcastle, manually removed any remaining folders/files related to either, then re-installed following the prescribed directions. My project now builds, but the resulting CHM file has problems. I get a "This program cannot display the webpage" error for every topic. Any suggestions?

Coordinator
Mar 3, 2010 at 7:15 PM

You'll see that error if you are trying to view the help file off of a network share.  Copy it to your local hard drive and you can open it from there.  If it's built on another machine, you may need to unblock it.  See the FAQ topic in the help file for how to allow viewing help files on network shares and how to unblock help files (Why doesn't my compiled help file load? / Why do all of the help file topics display a "Page not found" error?).

Eric

 

Mar 3, 2010 at 8:47 PM

Yes, I'm all to familiar with that behavior, but that's not the case here. The file is on my local file system and I'm addressing it using a local path. It's not showing as 'blocked' in Windows Explorer and there's no reason for it to be. This is really getting frustrating.

I've previously built CHM files for .NET 2.0 and 3.5 projects without any issues.

Coordinator
Mar 3, 2010 at 11:48 PM

Is there a "#" in the folder path?  That will also prevent it from displaying.  That's a limitation of the CHM viewer.  You need to move it to a folder where there isn't a "#" in the path or rename the folder that contains it.

Eric

 

Mar 4, 2010 at 1:09 PM

Wow, that was the problem. I use '#' as the folder name for my 'Main' branch - just a convention of mine. What a goofy limitation. Thanks!

Mar 4, 2010 at 1:17 PM

By the way, thanks for your patience and help getting this up and working. I use SHFB to build the CHM file for the TFS API documentation. It's a stop gap measure until we get our MSDN documentation updated. I've been wanting to generate a CHM file for the Workflow 4.0 Activities we ship for TFS Build, but hadn't been able to get it working. Now that I've gotten a canonical .NET 4.0 assembly working, I should be able to get documentation generated for our workflow activities.

Apr 15, 2010 at 12:21 AM

Also, going with EWoodruff's comment above. I was having trouble building the RTM version of .net 4.0.

The C:\Program Files (x86)\Sandcastle\ProductionTools\MrefBuilder.exe.config file needs to have the following added to it.

<supportedRuntime version="v4.0.30319"/> <!-- 4.0 RTM -->

May 7, 2010 at 11:11 PM

DuNuNuBatman:

Thanks, man! This solved my problem!

May 8, 2010 at 2:12 AM

Glad to help.