In this tutorial, you will learn how to fix a bug I encountered when installing Umbraco forms (via NuGet). After installation, my Umbraco V7 backend broke... badly. All the sections in my site vanished and nothing worked anymore, as seen below. If you have a similar issue then this tutorial will hopefully help you out 😊
To diagnose the issue, I first checked the logs to see if there were any errors being thrown, there were:
This issue was down to a dependency injection error. If your site is using dependency injection (mine was using Autofac) then the fix is to register the Umbraco Forms assemblies within your DI container. If you don't know where this is in your project I suggest you start looking in your Global.ascx
. To register a dependency with Autofaq, you will need to add some code similar to the snippet below:
Finding which dependencies needed registering was a pain, however, after adding the missing dependencies that the log file was complaining about, recompiling my project, and re-running my site, my backend worked. If your project uses dependency injection and you encounter a controller parameter exception, start trying to figure out what the missing dependencies are! Use the logs, GitHub, DotPeek etc... keep registering things until the issue goes away. Happy Coding 🤘