This fixes "System.InvalidOperationException: Unable to set active document" in AvalonDock.DockingManager.CoerceActiveDocumentValue.
(or at least one cause of that exception)
Use WebViewPage<dynamic> as Razor view's base class.
Add default namespaces for the Razor view class so extension methods show in completion:
System.Web.Mvc,
System.Web.Mvc.Ajax,
System.Web.Mvc.Html,
System.Web.Routing
The Razor view's base class and namespaces should be taken from the web.config but are currently hard coded.
BeforeBuildCustomToolProjectItems was not handling IBuildable derived classes that were not either a Project or Solution. This happens when a project is run and SharpDevelop is configured to build modified projects or build modified projects and dependent projects or when running unit tests.
Now custom tools are only run when a project or solution is explicitly rebuilt or built using the Build/Rebuild from the Build menu.
Pre-build custom tool runner was not handling that IProject.ProjectSpecificItems can be null for a project that has no preferences xml file already created (e.g. project created by Visual Studio and then opened in SharpDevelop).
Files added (e.g. T4MVC.tt) when installing a NuGet package were not getting a default CustomTool configured.
Now the CustomToolsService.GetCompatibleCustomToolNames() is used to find the first matching custom tool name for a file.
Add Custom Tools project options panel that can be used to enable running custom tools when a build is started just before the build executes.
Project options panel allows enabling/disabling this feature and specifying which files will have their custom tools run pre-build.
Configuration is stored in IProject.ProjectSpecificProperties.
An uninstalled folding manager would stay partially connected to the text view, which could cause the InvalidOperationException: "Trying to build visual line from collapsed line".