Partilhar via


Why you can only see base user control propeties in Design view?

This is fairly popular question.

The reason is that currently .NET runtime (CLR) has no means to unload control assembly. Therefore each time you change your control and new assembly is produced by ASP.NET runtime, it is loaded into the VS process space while old version remains in memory until you close VS (at which point VS appdomain will be unloaded). If you (or your fellow developer) are actively changing the control, VS working set will keep growing since more and more control assemblies will be loaded.

We have to load control assembly into the VS appdomain (as opposed to a separate appdomain which can be recycled) because control designer is part of the Visual Studio process and cannot work in a separate appdomain. This is architectural limitation which we are obviously looking to resolve in the future version of the Visual Studio. Meanwhile to prevent uncontrolled growth of the working set we use base class properties instead.

Technically, if you were only using the control, all of the above wouldn't be a problem, but how do we organize the feature in way so it won't confuse users? We are open to suggestions, of course :-)