This article is a mirror article of machine translation, please click here to jump to the original article.

View: 11500|Reply: 0

[Disassembly] After decompiling the .NET file with Reflector, manager, base. AutoScaleMode fix

[Copy link]
Posted on 8/6/2015 5:45:57 PM | | |
After the decompiled project file is opened with VS2010, a series of error messages appear when opening the form:

The first case:

"The designer cannot process the code on line 152: base. AutoScaleMode = AutoScaleMode.Font; The code inside the method "InitializeComponent" is generated by the designer and should not be modified manually. Please remove any changes and try reopening the designer".

The solution is: all controls in the System.Windows.Forms. namespace need to be declared in the full namespace, such as the base. AutoScaleMode = AutoScaleMode.Font; It should be changed to base. AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
Second case:

The variable "manager" is not declared or never assigned. ”

The solution is that this method is limited to forms that contain the System.Resources.ResourceManager call in the InitializeComponent

1. Resource file format conversion, convert .resources (binary) files to .resx files (XML) XP under C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin resgen.exe, and use C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin for WIN7  CMD command format: resgen *.resources *.resx (.resx file preferably has the same name as the form .cs file)

2. Replace the object manager in the InitializeComponent method with resources (yes, only replace the variable name ^_^, replace all of them, the best way is to change the manager's declaration)

3. Put the resource file .resx under the same folder .cs the form file.

4. Exclude all forms (.cs) from the project and add them before adding them (this will save you the process of mapping .resx files to .csproj).




Previous:In August 2015, every Wednesday and Friday, the Wuhan International Convention and Exhibition Center held a job fair for Central China Talents
Next:Tips for showing/hiding DIV (difference between visibility and display)
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com