Support for .NET Micro Framework (NETMF)

Topics: User Forum
Jun 25, 2013 at 6:02 PM
Since there is no native support for NETMF, I tried to hack SHFB to build my project using dll, exe and xml files, but it ended up documenting ALL the included dll files from the micro framework, and only one class from my program exe.

It would be very helpful if support for the NET micro framework (latest is 4.2 ish - http://www.netmf.com/) could be added.
Coordinator
Jun 25, 2013 at 8:21 PM
If it follows the conventions of the other frameworks, you can define it. This can be done by editing the %ProgramFiles(x86)%\Sandcastle\ProductionTools\Frameworks.xml file. You can clone the framework entry closest to it, update the platform, version, and title attributes, and set the proper base path in the main assembly location entry. If additional assemblies are needed, you can add entries for those as well. You may need to adjust the version number in the assembly detail entries too.

Eric
Jun 26, 2013 at 9:44 AM
Thanks for the reply
Unfortunately I can't get it to work, despite numerous attempts.
I keep getting the "SHFB: Error BE0071: Unable to locate information for the project framework version..."

My added xml is
<Framework Platform=".NETMicroFramework" Version="4.2.0.0" Title=".NET Micro Framework 4.2">
    <AssemblyLocations>
        <Location IsCore="true" Path="%Program Files%\Reference Assemblies\Microsoft\Framework\.NETMicroFramework\v4.2">
            <AssemblyDetails Filename="Clock.dll" Name="Clock" Version="1.0.0.0" PublicKeyToken="2670f5f21e7f4192" />
etc.

with the <AssemblyLocations> taken directly from Microsoft's own "FrameworkList.xml" file.
And there are definitely a bunch of xml and dll files in the location path specified.

Thanks for trying anyway.
Coordinator
Jun 26, 2013 at 8:27 PM
The Platform value should match the TargetFrameworkIdentifier property from the .NET Micro Framework project you're trying to document. Likewise the Version value should match the TargetFrameworkVersion project property. A mismatch in either of those would also cause it to not find the framework in the definition file.

Eric
Jun 27, 2013 at 9:29 AM
Sadly it still won't work after those changes.
I couldn't actually find the TargetFrameworkIdentifier tag in the .csproj xml file, but I tried a few variations anyway, and tried adding that element to the csproj file.
Coordinator
Jun 27, 2013 at 8:23 PM
When I get some time I'll take a look at it. I'm going to set up a VM to see what's new in the VS 2013 preview and .NET 4.5.1 so I'll probably do it then.

Eric
Mar 16, 2014 at 1:04 PM
Edited Mar 16, 2014 at 1:32 PM
I have managed to add the .NETMicroframework 4.2 successfully to the Frameworks.xml file.
I don't get the "SHFB: Error BE0071: Unable to locate information for the project framework version..." error mentined obove, and I think the problem up there was the location, which must be the x86 programs folder:
    <Framework Platform=".NETMicroFramework" Version="4.2.0.0" Title=".NETMicroFramework 4.2">
        <AssemblyLocations>
            <Location IsCore="true" Path="%ProgramFiles(x86)%\Reference Assemblies\Microsoft\Framework\.NETMicroFramework\v4.2">
                <AssemblyDetails Filename="MFDpwsClient.dll" Name="MFDpwsClient" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
                <AssemblyDetails Filename="MFDpwsDevice.dll" Name="MFDpwsDevice" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
                <AssemblyDetails Filename="MFDpwsExtensions.dll" Name="MFDpwsExtensions" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
                <AssemblyDetails Filename="MFUpdate.dll" Name="MFUpdate" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
                <AssemblyDetails Filename="MFWsStack.dll" Name="MFWsStack" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
                <AssemblyDetails Filename="Microsoft.SPOT.Graphics.dll" Name="Microsoft.SPOT.Graphics" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
                <AssemblyDetails Filename="Microsoft.SPOT.Hardware.dll" Name="Microsoft.SPOT.Hardware" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
                <AssemblyDetails Filename="Microsoft.SPOT.Hardware.OneWire.dll" Name="Microsoft.SPOT.Hardware.OneWire" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
                <AssemblyDetails Filename="Microsoft.SPOT.Hardware.PWM.dll" Name="Microsoft.SPOT.Hardware.PWM" Version="4.2.0.1" PublicKeyToken="2670f5f21e7f4192"/>
                <AssemblyDetails Filename="Microsoft.SPOT.Hardware.SerialPort.dll" Name="Microsoft.SPOT.Hardware.SerialPort" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
                <AssemblyDetails Filename="Microsoft.SPOT.Hardware.Usb.dll" Name="Microsoft.SPOT.Hardware.Usb" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
                <AssemblyDetails Filename="Microsoft.SPOT.Ink.dll" Name="Microsoft.SPOT.Ink" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
                <AssemblyDetails Filename="Microsoft.SPOT.IO.dll" Name="Microsoft.SPOT.IO" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
                <AssemblyDetails Filename="Microsoft.SPOT.Native.dll" Name="Microsoft.SPOT.Native" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
                <AssemblyDetails Filename="Microsoft.SPOT.Net.dll" Name="Microsoft.SPOT.Net" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
                <AssemblyDetails Filename="Microsoft.SPOT.Net.Security.dll" Name="Microsoft.SPOT.Net.Security" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
                <AssemblyDetails Filename="Microsoft.SPOT.RPC.dll" Name="Microsoft.SPOT.RPC" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
                <AssemblyDetails Filename="Microsoft.SPOT.Security.PKCS11.dll" Name="Microsoft.SPOT.Security.PKCS11" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
                <AssemblyDetails Filename="Microsoft.SPOT.Time.dll" Name="Microsoft.SPOT.Time" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
                <AssemblyDetails Filename="Microsoft.SPOT.TinyCore.dll" Name="Microsoft.SPOT.TinyCore" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
                <AssemblyDetails Filename="Microsoft.SPOT.Touch.dll" Name="Microsoft.SPOT.Touch" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
                <AssemblyDetails Filename="Microsoft.SPOT.Update.dll" Name="Microsoft.SPOT.Update" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
                <AssemblyDetails Filename="Microsoft.VisualBasic.dll" Name="Microsoft.VisualBasic" Version="1.0.0.0" PublicKeyToken="2670f5f21e7f4192"/>
                <AssemblyDetails Filename="mscorlib.dll" Name="mscorlib" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
                <AssemblyDetails Filename="System.dll" Name="System" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
                <AssemblyDetails Filename="System.Ftp.dll" Name="System.Ftp" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
                <AssemblyDetails Filename="System.Http.dll" Name="System.Http" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
                <AssemblyDetails Filename="System.IO.dll" Name="System.IO" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
                <AssemblyDetails Filename="System.Net.Security.dll" Name="System.Net.Security" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
                <AssemblyDetails Filename="System.Security.dll" Name="System.Security" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
                <AssemblyDetails Filename="System.Text.RegularExpressions.dll" Name="System.Text.RegularExpressions" Version="0.0.0.0" PublicKeyToken="2670f5f21e7f4192"/>
                <AssemblyDetails Filename="System.Xml.dll" Name="System.Xml" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
                <AssemblyDetails Filename="System.Xml.Legacy.dll" Name="System.Xml.Legacy" Version="4.2.0.0" PublicKeyToken="2670f5f21e7f4192"/>
            </Location>
        </AssemblyLocations>
    </Framework>
But I get an build error now:
------ Build started: Project: TinkrApiDoc, Configuration: Release Any CPU ------
    Building E:\Tinkr\Tinkr2\4.2\TinkrApiDoc\TinkrApiDoc.shfbproj
    Initializing
    ClearWorkFolder
    ValidatingDocumentationSources
    GenerateSharedContent
    GenerateApiFilter
    GenerateReflectionInfo
SHFB(0,0): error BE0043: Unexpected error detected in last build step.  See output above for details.
    Failed
    Build details can be found in E:\Tinkr\Tinkr2\4.2\TinkrApiDoc\Help\LastBuild.log
Done building project "TinkrApiDoc.shfbproj" -- FAILED.
========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========
Looking at he log file:
<?xml version="1.0" encoding="utf-8"?>
<shfbBuild product="Sandcastle Help File Builder" version="2014.2.15.0 Beta" projectFile="E:\Tinkr\Tinkr2\4.2\TinkrApiDoc\TinkrApiDoc.shfbproj" started="16.03.2014 12:59:14">
<buildStep step="Initializing">
Finding tools...
The Sandcastle tools are located in &#39;C:\Program Files (x86)\EWSoftware\Sandcastle Help File Builder\&#39;
Searching for HTML Help 1 compiler...
Found HTML Help 1 compiler in &#39;C:\Program Files (x86)\HTML Help Workshop\&#39;
Locating components...
Using presentation style &#39;VS2010&#39; located in &#39;C:\Program Files (x86)\EWSoftware\Sandcastle Help File Builder\PresentationStyles\VS2010&#39;
</buildStep>
<buildStep step="ClearWorkFolder">
Clearing working folder...
</buildStep>
<buildStep step="ValidatingDocumentationSources">
Validating and copying documentation source information
Source: E:\Tinkr\Tinkr2\4.2\AphelionCore\AphelionCore\AphelionCore.csproj
    Found project &#39;E:\Tinkr\Tinkr2\4.2\AphelionCore\AphelionCore\AphelionCore.csproj&#39;

Parsing project files
    Found assembly &#39;E:\Tinkr\Tinkr2\4.2\AphelionCore\AphelionCore\bin\Release\Skewworks.NETMF.Core.dll&#39;

References to include (excluding framework assemblies):
    None

Copying XML comments files
    E:\Tinkr\Tinkr2\4.2\AphelionCore\AphelionCore\bin\Release\Skewworks.NETMF.Core.XML -&gt; E:\Tinkr\Tinkr2\4.2\TinkrApiDoc\Help\Working\Skewworks.NETMF.Core.XML
</buildStep>
<buildStep step="GenerateSharedContent">
Generating shared content files (en-US, English (United States))...
    Last step completed in 00:00:00.0000
</buildStep>
<buildStep step="GenerateApiFilter">
Generating API filter for MRefBuilder...
    Last step completed in 00:00:00.0469
</buildStep>
<buildStep step="GenerateReflectionInfo">
Generating reflection information...
[C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe]
Der Buildvorgang wurde am 16.03.2014 12:59:15 gestartet.
Projekt &quot;E:\Tinkr\Tinkr2\4.2\TinkrApiDoc\Help\Working\GenerateRefInfo.proj&quot; auf Knoten &quot;1&quot; (Standardziele).
PrepareForBuild:
  Das Verzeichnis &quot;obj\Debug\&quot; wird erstellt.
GenerateRefInfo:
  MRefBuilder (v2014.1.26.0)
  Copyright &#184; 2006-2014, Microsoft Corporation, All Rights Reserved.
  Portions Copyright &#184; 2006-2014, Eric Woodruff, All Rights Reserved.
  Loaded 1 assemblies for reflection and 0 dependency assemblies.
MRefBuilder : error : Unresolved assembly reference: Microsoft.SPOT.Native (Microsoft.SPOT.Native, Version=4.2.0.0, Culture=neutral, PublicKeyToken=null) required by Skewworks.NETMF.Core [E:\Tinkr\Tinkr2\4.2\TinkrApiDoc\Help\Working\GenerateRefInfo.proj]
    Last step completed in 00:00:00.3281
</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>
</shfbBuild>
It can't find the Microsoft.SPOT.Native assembly, which is there. But may be it tries to load it, what might not work!?
Any ideas?

One more info:
According to the xml file where I got the assemblies from, they are not in GAC. Might that be a problem?
Mar 16, 2014 at 5:49 PM
I temporary fixed it by using the 'Assembly Binding Redirection' plug-in.
When I add the NETMF core assemblies the build works now.
Coordinator
Mar 16, 2014 at 8:21 PM
It looks like the difference is that the one it's looking for doesn't have a public key token. Setting it to null in the Frameworks.xml file would probably make it work unless there is another version with a token. In the other frameworks, some assemblies do have different tokens so the same could be true of the .NET micro framework.

Eric
Mar 16, 2014 at 9:42 PM
Thank you for the reply.
How do I set it to null?
I already tried by removing the PublicKeyToken attribute with no luck.
Reinhard.
Coordinator
Mar 17, 2014 at 2:09 AM
You should be able to leave the PublicKeyToken attribute off of the AssemblyDetails element. I'll have to check it out.

Eric
Apr 10, 2014 at 2:34 AM
Edited Apr 10, 2014 at 2:50 AM
Eric, did you get a chance to follow up on this? I'm in the same boat as osre, with the mysterious 'unexpected error detected in previous step' message, I see that osre managed to hack it by doing some sort of redirect, but I'm not sure exactly what to do there. Any thoughts? I added Microsoft.SPOT.* to the 'ignore' tab, now I'm getting this in my build log...
  MRefBuilder (v2.7.4.0)
  Copyright &#184; 2006-2013, Microsoft Corporation, All Rights Reserved.
  Portions Copyright &#184; 2006-2013, Eric Woodruff, All Rights Reserved.
  Info: Loaded 1 assemblies for reflection and 0 dependency assemblies.
  
  Unhandled Exception: System.TypeInitializationException: The type initializer for &#39;System.Compiler.SystemTypes&#39; threw an exception. ---&gt; System.InvalidCastException: Unable to cast object of type &#39;System.Compiler.Class&#39; to type &#39;System.Compiler.Struct&#39;.
     at System.Compiler.SystemTypes.Initialize(Boolean doNotLockFile, Boolean getDebugInfo)
     --- End of inner exception stack trace ---
     at System.Compiler.TypeNode.get_DefaultMembers()
     at Microsoft.Ddue.Tools.Reflection.ReflectionUtilities.IsDefaultMember(Member member)
     at Microsoft.Ddue.Tools.ManagedReflectionWriter.WriteMemberData(Member member)
     at Microsoft.Ddue.Tools.ManagedReflectionWriter.WriteMember(Member member, TypeNode type)
     at Microsoft.Ddue.Tools.ManagedReflectionWriter.VisitMember(Member member)
     at Microsoft.Ddue.Tools.Reflection.ApiVisitor.VisitMembers(MemberList members)
     at Microsoft.Ddue.Tools.Reflection.ApiVisitor.VisitTypes(TypeNodeList types)
     at Microsoft.Ddue.Tools.Reflection.ApiVisitor.VisitNamespaces(NamespaceList spaces)
     at Microsoft.Ddue.Tools.ManagedReflectionWriter.VisitNamespaces(NamespaceList spaces)
     at Microsoft.Ddue.Tools.Reflection.ApiVisitor.VisitApis()
     at Microsoft.Ddue.Tools.MRefBuilder.Main(String[] args)
C:\Users\Tim\Projects\TA.NetMF.StepperDriver\TA.AcceleratedStepperDriver.Documentation\Help\Working\GenerateRefInfo.proj(44,5): error MSB6006: &quot;MRefBuilder.exe&quot; exited with code -532462766.
    Last step completed in 00:00:03.3511
</buildStep>
<buildStep step="Failed">
Apr 10, 2014 at 7:55 AM
I get this one too now.
It worked for a couple of days, but the (without any update to SHFB) it didn't work anymore with the same exception as you get.
I only made minor changes in my project, where no struct was involved.
Eric asked me for a simple sample to reproduce this, but my project is quite huge: https://github.com/osre77/Tinkr
So if yours is smaller you could send it to Eric.
Coordinator
Apr 10, 2014 at 8:42 PM
To date, I haven't looked into supporting the .NET Micro Framework. I will at some point but don't have a definite plan for supporting it yet.

Eric
Apr 19, 2014 at 9:22 AM
Edited Apr 19, 2014 at 11:02 AM
I managed to fix the problem that the NETMF assemblies are not found, without ignoring them.
I replaced the PublicKeyTokens with the term "null"
My extension to Frameworks.xml now looks like this for NETMF 4.2:
    <Framework Platform=".NETMicroFramework" Version="4.2.0.0" Title=".NETMicroFramework 4.2">
        <AssemblyLocations>
            <Location IsCore="true" Path="%ProgramFiles(x86)%\Reference Assemblies\Microsoft\Framework\.NETMicroFramework\v4.2">
                <AssemblyDetails Filename="MFDpwsClient.dll" Name="MFDpwsClient" Version="4.2.0.0" PublicKeyToken="null"/><!--PublicKeyToken="2670f5f21e7f4192"/>-->
                <AssemblyDetails Filename="MFDpwsDevice.dll" Name="MFDpwsDevice" Version="4.2.0.0" PublicKeyToken="null"/><!--PublicKeyToken="2670f5f21e7f4192"/>-->
                <AssemblyDetails Filename="MFDpwsExtensions.dll" Name="MFDpwsExtensions" Version="4.2.0.0" PublicKeyToken="null"/><!--PublicKeyToken="2670f5f21e7f4192"/>-->
                <AssemblyDetails Filename="MFUpdate.dll" Name="MFUpdate" Version="4.2.0.0" PublicKeyToken="null"/><!--PublicKeyToken="2670f5f21e7f4192"/>-->
                <AssemblyDetails Filename="MFWsStack.dll" Name="MFWsStack" Version="4.2.0.0" PublicKeyToken="null"/><!--PublicKeyToken="2670f5f21e7f4192"/>-->
                <AssemblyDetails Filename="Microsoft.SPOT.Graphics.dll" Name="Microsoft.SPOT.Graphics" Version="4.2.0.0" PublicKeyToken="null"/><!--PublicKeyToken="2670f5f21e7f4192"/>-->
                <AssemblyDetails Filename="Microsoft.SPOT.Hardware.dll" Name="Microsoft.SPOT.Hardware" Version="4.2.0.0" PublicKeyToken="null"/><!--PublicKeyToken="2670f5f21e7f4192"/>-->
                <AssemblyDetails Filename="Microsoft.SPOT.Hardware.OneWire.dll" Name="Microsoft.SPOT.Hardware.OneWire" Version="4.2.0.0" PublicKeyToken="null"/><!--PublicKeyToken="2670f5f21e7f4192"/>-->
                <AssemblyDetails Filename="Microsoft.SPOT.Hardware.PWM.dll" Name="Microsoft.SPOT.Hardware.PWM" Version="4.2.0.1" PublicKeyToken="null"/><!--PublicKeyToken="2670f5f21e7f4192"/>-->
                <AssemblyDetails Filename="Microsoft.SPOT.Hardware.SerialPort.dll" Name="Microsoft.SPOT.Hardware.SerialPort" Version="4.2.0.0" PublicKeyToken="null"/><!--PublicKeyToken="2670f5f21e7f4192"/>-->
                <AssemblyDetails Filename="Microsoft.SPOT.Hardware.Usb.dll" Name="Microsoft.SPOT.Hardware.Usb" Version="4.2.0.0" PublicKeyToken="null"/><!--PublicKeyToken="2670f5f21e7f4192"/>-->
                <AssemblyDetails Filename="Microsoft.SPOT.Ink.dll" Name="Microsoft.SPOT.Ink" Version="4.2.0.0" PublicKeyToken="null"/><!--PublicKeyToken="2670f5f21e7f4192"/>-->
                <AssemblyDetails Filename="Microsoft.SPOT.IO.dll" Name="Microsoft.SPOT.IO" Version="4.2.0.0" PublicKeyToken="null"/><!--PublicKeyToken="2670f5f21e7f4192"/>-->
                <AssemblyDetails Filename="Microsoft.SPOT.Native.dll" Name="Microsoft.SPOT.Native" Version="4.2.0.0" PublicKeyToken="null"/><!--PublicKeyToken="2670f5f21e7f4192"/>-->
                <AssemblyDetails Filename="Microsoft.SPOT.Net.dll" Name="Microsoft.SPOT.Net" Version="4.2.0.0" PublicKeyToken="null"/><!--PublicKeyToken="2670f5f21e7f4192"/>-->
                <AssemblyDetails Filename="Microsoft.SPOT.Net.Security.dll" Name="Microsoft.SPOT.Net.Security" Version="4.2.0.0" PublicKeyToken="null"/><!--PublicKeyToken="2670f5f21e7f4192"/>-->
                <AssemblyDetails Filename="Microsoft.SPOT.RPC.dll" Name="Microsoft.SPOT.RPC" Version="4.2.0.0" PublicKeyToken="null"/><!--PublicKeyToken="2670f5f21e7f4192"/>-->
                <AssemblyDetails Filename="Microsoft.SPOT.Security.PKCS11.dll" Name="Microsoft.SPOT.Security.PKCS11" Version="4.2.0.0" PublicKeyToken="null"/><!--PublicKeyToken="2670f5f21e7f4192"/>-->
                <AssemblyDetails Filename="Microsoft.SPOT.Time.dll" Name="Microsoft.SPOT.Time" Version="4.2.0.0" PublicKeyToken="null"/><!--PublicKeyToken="2670f5f21e7f4192"/>-->
                <AssemblyDetails Filename="Microsoft.SPOT.TinyCore.dll" Name="Microsoft.SPOT.TinyCore" Version="4.2.0.0" PublicKeyToken="null"/><!--PublicKeyToken="2670f5f21e7f4192"/>-->
                <AssemblyDetails Filename="Microsoft.SPOT.Touch.dll" Name="Microsoft.SPOT.Touch" Version="4.2.0.0" PublicKeyToken="null"/><!--PublicKeyToken="2670f5f21e7f4192"/>-->
                <AssemblyDetails Filename="Microsoft.SPOT.Update.dll" Name="Microsoft.SPOT.Update" Version="4.2.0.0" PublicKeyToken="null"/><!--PublicKeyToken="2670f5f21e7f4192"/>-->
                <AssemblyDetails Filename="Microsoft.VisualBasic.dll" Name="Microsoft.VisualBasic" Version="1.0.0.0" PublicKeyToken="null"/><!--PublicKeyToken="2670f5f21e7f4192"/>-->
                <AssemblyDetails Filename="mscorlib.dll" Name="mscorlib" Version="4.2.0.0" PublicKeyToken="null"/><!--PublicKeyToken="2670f5f21e7f4192"/>-->
                <AssemblyDetails Filename="System.dll" Name="System" Version="4.2.0.0" PublicKeyToken="null"/><!--PublicKeyToken="2670f5f21e7f4192"/>-->
                <AssemblyDetails Filename="System.Ftp.dll" Name="System.Ftp" Version="4.2.0.0" PublicKeyToken="null"/><!--PublicKeyToken="2670f5f21e7f4192"/>-->
                <AssemblyDetails Filename="System.Http.dll" Name="System.Http" Version="4.2.0.0" PublicKeyToken="null"/><!--PublicKeyToken="2670f5f21e7f4192"/>-->
                <AssemblyDetails Filename="System.IO.dll" Name="System.IO" Version="4.2.0.0" PublicKeyToken="null"/><!--PublicKeyToken="2670f5f21e7f4192"/>-->
                <AssemblyDetails Filename="System.Net.Security.dll" Name="System.Net.Security" Version="4.2.0.0" PublicKeyToken="null"/><!--PublicKeyToken="2670f5f21e7f4192"/>-->
                <AssemblyDetails Filename="System.Security.dll" Name="System.Security" Version="4.2.0.0" PublicKeyToken="null"/><!--PublicKeyToken="2670f5f21e7f4192"/>-->
                <AssemblyDetails Filename="System.Text.RegularExpressions.dll" Name="System.Text.RegularExpressions" Version="0.0.0.0" PublicKeyToken="null"/><!--PublicKeyToken="2670f5f21e7f4192"/>-->
                <AssemblyDetails Filename="System.Xml.dll" Name="System.Xml" Version="4.2.0.0" PublicKeyToken="null"/><!--PublicKeyToken="2670f5f21e7f4192"/>-->
                <AssemblyDetails Filename="System.Xml.Legacy.dll" Name="System.Xml.Legacy" Version="4.2.0.0" PublicKeyToken="null"/><!--PublicKeyToken="2670f5f21e7f4192"/>-->
            </Location>
        </AssemblyLocations>
    </Framework>
I have also 'fixed' the InvalidCastException issue:
https://shfb.codeplex.com/workitem/35072
Apr 20, 2014 at 10:15 AM
I've tried the above modification and it does seem to fix the problems locating the assemblies, but I'm getting a different error now:
[C:\Program Files (x86)\MSBuild\12.0\bin\MSBuild.exe]
  MRefBuilder (v2.7.4.0)
  Copyright &#184; 2006-2013, Microsoft Corporation, All Rights Reserved.
  Portions Copyright &#184; 2006-2013, Eric Woodruff, All Rights Reserved.
  Info: Loaded 1 assemblies for reflection and 0 dependency assemblies.
  
  Unhandled Exception: System.TypeInitializationException: The type initializer for &#39;System.Compiler.SystemTypes&#39; threw an exception. ---&gt; System.InvalidCastException: Unable to cast object of type &#39;System.Compiler.Class&#39; to type &#39;System.Compiler.Struct&#39;.
     at System.Compiler.SystemTypes.Initialize(Boolean doNotLockFile, Boolean getDebugInfo)
     --- End of inner exception stack trace ---
     at System.Compiler.TypeNode.get_DefaultMembers()
     at Microsoft.Ddue.Tools.Reflection.ReflectionUtilities.IsDefaultMember(Member member)
     at Microsoft.Ddue.Tools.ManagedReflectionWriter.WriteMemberData(Member member)
     at Microsoft.Ddue.Tools.ManagedReflectionWriter.WriteMember(Member member, TypeNode type)
     at Microsoft.Ddue.Tools.ManagedReflectionWriter.VisitMember(Member member)
     at Microsoft.Ddue.Tools.Reflection.ApiVisitor.VisitMembers(MemberList members)
     at Microsoft.Ddue.Tools.Reflection.ApiVisitor.VisitTypes(TypeNodeList types)
     at Microsoft.Ddue.Tools.Reflection.ApiVisitor.VisitNamespaces(NamespaceList spaces)
     at Microsoft.Ddue.Tools.ManagedReflectionWriter.VisitNamespaces(NamespaceList spaces)
     at Microsoft.Ddue.Tools.Reflection.ApiVisitor.VisitApis()
     at Microsoft.Ddue.Tools.MRefBuilder.Main(String[] args)
C:\Users\Tim\Projects\TA.NetMF.StepperDriver\TA.AcceleratedStepperDriver.Documentation\Help\Working\GenerateRefInfo.proj(44,5): error MSB6006: &quot;MRefBuilder.exe&quot; exited with code -532462766.
    Last step completed in 00:00:03.1719
</buildStep>
<buildStep step="Failed">

SHFB: Error BE0043: Unexpected error detected in last build step.  See output above for details.
That seems to imply that MRefBuilder is crashing. Does enyone have any ideas? My MF project is really rather simple!
--Tim
Apr 20, 2014 at 4:46 PM
You have to replace MRefBuilder.exe
Follow the link to the other issue:
https://shfb.codeplex.com/workitem/35072
Apr 20, 2014 at 9:04 PM

I’m not really comfortable with hacking the build tools, I need them to work for other projects. I would rather wait until Eric has had a chance to look into it and fix it properly.

Eric, I’m happy to provide my solution if that is any help – it is much smaller than osre’s solution. It’s in a private repository on BitBucket, I have sent you an invitation to view the repo.

--Tim

Apr 20, 2014 at 9:57 PM
I currently trying to find out what exactly is causing the exception. Then Eric can make a proper fix in one of the next versions.
btw. My hack should not make any difference for other projects.

About your smaller solution: Do you mean the entry in Frameworks.xml?
How could it be smaller than to have a entry per framework assembly?
Of course, the commented PublicKeyToikens can be taken out, but I thought I leave them there, even that they must be null.
Apr 20, 2014 at 10:44 PM
I mean my visual studio solution is small, only a single project with, basically, a single class. It should be much easier for Eric to figure out what’s going on.

Sent from Windows Mail

Coordinator
Apr 20, 2014 at 11:15 PM
Edited Apr 20, 2014 at 11:20 PM
I got it, downloaded the code, and was able to duplicate the issue. The problem occurs when MRefBuilder assigns a bunch of system types to various variables. It turns out that in the .NET Micro Framework the DictionaryEntry type is a class whereas it is a struct in all the other frameworks, hence the invalid cast exception since MRefBuilder is always excepting a struct. As it turns out, the assignment doesn't appear to be used anywhere so changing it to use an "as" statement rather than a cast and letting it get assigned null when not a struct corrects the issue. Chances are I could remove the variables being assigned in that section since none of them appear to be used but they may have some other purpose such as ensuring the assemblies are loaded. As such, I'm going to leave them in there with the change to the DictionaryEntry assignment. All the others appear to be of the type expected.

I'm planning on issuing a new release tomorrow so it will include this fix along with the necessary entries in Frameworks.xml to support the .NET Micro Frameworks 4.2 and 4.3. You will need to reset the Framework Version property in your SHFB projects as the title will be different.

Eric
Apr 20, 2014 at 11:57 PM
That is excellent news Eric, thank you!!

Sent from Windows Mail

Apr 21, 2014 at 10:22 AM
That's great.
I just wanted to start debugging :)
Apr 22, 2014 at 4:34 PM

FYI I have tried the new release and it is working beautifully. Thank you Eric!

--Tim Long

Apr 22, 2014 at 5:34 PM
Works great for me too.
Good work.