Installation steps

Usage notes

Using new project type called WebControlsLibrary will change content of .csproj file and add following lines to execute custom msbuild target file:
<Import Project="$(MSBuildExtensionsPath)\DeployWebLib\DeployWebLib.targets" />
<Target Name="AfterBuild" DependsOnTargets="ModuleDeploy" />

Important Note

When you unloads project and than gets back with Reload project command you get this "security warning...":
DeployWebLib.png
Loading user control at runtime:
Old way of loading user control at runtime into place holder:
Control control = Page.LoadControl("~/Controls/UserControl1.ascx");
ph.Controls.Add(control);
But when you try to build web library the old way (without DeployWebLib target) and use other way to load user control from DLL:
Type typeOfControl = typeof(UserControl1);
Control control = Page.LoadControl(typeOfControl, null);
ph.Controls.Add(control);
Which will be executed without error, but no user control is added to placeholder.
This is because library does NOT contains ANY metadata about user controls within library.
But also when you use code above up to library builded new way with DeployWebLib you got same issue - NO user control is loaded.
This is because merging user control using DeployWebLib puts users controls metadata under special namespace folder called ASP (internal data are also under _ASP - but we dont care about this).
var registerUserType = typeof(RegisterUser).GetWebEmbeddControlType();
// and now load page control and add it to controls collection of place holder
Control control = Page.LoadControl(registerUserType, null);
ph.Controls.Add(control);

Demo Example documentation

See more info about this in Demo Example documentation.