So you’ve setup you docfx documentation project.  You ran it, clicked on the api documentation link and there was nothing.

You might need to thank Microsoft; it turns out that Microsoft recently (July/August 2022 timeframe) made a change that broke a couple of things and depending on your systems configuration you may, or not, run into this issue.  For docFX it looks like it was reported in mid July but there other packages and framesworks impacted.  The good news is that it is fairly easy to fix.  You can read more about the issue here.  My thanks to Jon Skeet who posted this “hacky fix”.  I simply extrapolated the fix for the DocFX.console package and put together some basic directions.  

  1. In your documentation project expand the dependencies
  2. Expand the packages
  3. View the properties of the docfx.console package and grab the path
  4. Open the docfx.console package path (something like C:\Users\<user>\.nuget\packages\docfx.console\<version>) in the file explorer
  5. Use your favorite text editor (or VS) and open docfx.exe.config from the tools directory
  6. Add the following assembly Binding in the runtime section of the config.
  7. <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
           <dependentAssembly>
             <assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
             <bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
           </dependentAssembly>
         </assemblyBinding>

  8. Rebuild your documentation project and try again.  If you get an error about the dll missing, your configuration is different from my setup and that’s ok.  Here is what you need to do-
  9. Download System.Memory NuGet package version 4.5.5 from nuget.org
  10. Extract lib/net461/System.Memory.dll to the tools directory in docfx.console package path.
  11. Rebuild your documentation project and try again.  At this point it should work.

If you have docFX installed and use the command line options you may need to repeat the same process for the docFX install.

Happy Coding!