I've created a custom control using C#, .Net3.5, and Visual Studio 2008.
I'm then adding that control to another control by dragging it from the toolbox.
After doing this when I try to compile I get an error as follows:
Error 1 Warning as Error: Field 'MyNamespace.MyControl._myCustomControl' is never assigned to, and will always have its default value null
Looking at the Designer.cs file this is due to the fact that VS never generates the following code:
this._rgReportGallery = new MyNameSpace.MyCustomControl();
The field itself is there, and the code to add it to the control I'm putting it in, just the instantiation code is missing.
I can add that code manually and everything seems to work, but as soon as the designer.cs file is regenerated it goes missing again.
I've even successfully added a different custom control and had that code get generated.
Does anybody know what could be causing this?