Revision control systems, which to choose from?, These days, not using Revision Control System is a crime against yourself. Instead of back-up, it should be a use of some Revision Control System, committing in small steps, to be able to trace back back by any number of steps.Some addition to the advice by Bill (Solution 2). Hopefully, if you have Class files (all code, no GUI), those can be left untouched and restored easily. While #5 is an extreme measure, it has worked for me the few times I've had to do it. open the code-behind pages for UserControls, and Forms, and paste in the saved code. Open the Designer.cs files of the Forms or UserControls in the new Project, and paste in the saved code. are all the same as the Project/Solution you are trying to salvage. you had in the original Project/Solution: drop the same Controls on the Forms or UserControls. create a new Project/Solution: re-create the Forms, UserControls, etc. you could try modifying your back-up copy step-by-step until you have a working app, and then try re-creating only those parts of your app that refuse to give you the design-time view you expect. If you're lucky, you just might find some key difference, a difference that can be fixed. drop a MenuStrip on it, then copy the Designer.cs file, and close the Solution, and paste the Designer.cs file copy in a text editor: compare its structure carefully with the structure of the Designer.cs file that you know is not working for you (not giving a proper design-time view). close the Project/Solution, and try re-opening it: if that doesn't work, quit Visual Studio, re-open it, and reload the Project/Solution: if that doesn't work then:ģ. immediately make a back-up copy of the whole Application.Ģ. I failed to find solution in the internet, so would highly appreciate your help.Sometimes a WinForms app gets corrupted, and you can't get the design-time view of a Form, or UserControl, to appear correctly, but you do, as you show here, have what looks like a valid Designer.cs file, and valid code-behind pages.ġ. I have checked the resource file and all MenuStripItems have all translations/values there. Linked into assembly "" at compile time, or thatĪll the satellite assemblies required are loadable and fully signed. The specified culture or the neutral culture. Now when I change culture at runtime, I get the following exception:Īn unhandled exception of type '' occurred inĪdditional information: Could not find any resources appropriate for I used another developer's code sample from this forum and made minor changes. String text = res2.GetString(m.Name + ".Text", lang) //Exception is thrown here resources.ApplyResources(m, m.Name, lang) Private void ApplyResourcesToolStripMenuItem(CultureInfo lang)įoreach (ToolStripItem m in ) Res2 = new ComponentResourceManager(typeof(MenuStrip)) ResManager = new ComponentResourceManager(this.GetType()) If (login.ShowDialog() = DialogResult.OK) Private void signOutToolStripMenuItem_Click(object sender, EventArgs e) Here is the code which I used specifically for MenuStrip: protected ComponentResourceManager res2 When I try to change the culture dynamically all controls are changing the language as it must be except the MenuStrip. I have a MenuStrip control with all translations entered for several languages.
0 Comments
Leave a Reply. |