Visual Studio - Menu items and toolbar buttons missing after deleting a resource
Something very strange happened here in Visual Studio 2008 (C#).
After deleting an icon resource from my project all my menu items and toolbar buttons disappeared. I chec开发者_C百科ked my form Designer.cs file and the code to the items are still there. Also, I tried to search for the deleted resource file name (warning.ico) in the entire solution, and nothing was found.
Does anyone knows what happened and how can I fix this?
Thanks
Just discovered.
Somehow, Visual Studio messed the Designer.cs file of my form. After close inspection, the AddRange Method of my menu and toolbar was missing.
Just fixed manually by adding:
this.mainToolbar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.lsbPort });
This bug still persists in VS2010. It happened to me after changing the location of an image resource outside of VS. VS reported an error and I relinked to the new location. Everything appeared fine until the next start of Visual Studio. All controls (including separators) of any toolbar in my application were gone.
All I can say is: the fix still works as described.
Edit: And the bug persists in VS2015. And (as I have just found out) in VS2019
精彩评论