To prevent possible data loss in windows form c#

0

If i click to Form1.cs in windows form , i get below exception,

To prevent possible data loss before loading the designer , the following errors must be resolved:

Loading this assembly would produce a different grant set from other instances.(Exception from HRESULT 0x80131401)

Could not find type 'Gizmox.WebGUI.Forms.Form'. Please make sure that the assembly that contains this type is referenced. If this type is a part of your development project, make sure that the project has been successfully built using settings for your current platform or Any CPU.

Call Stack :

at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.Error(IDesignerSerializationManager manager, String exceptionText, String helpLink) at System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.Deserialize(IDesignerSerializationManager manager, CodeTypeDeclaration declaration) at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager) at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager) at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32 fReload)

Any help will be greatly appreciated.

Thanks.

c#
exception
asked on Stack Overflow Nov 12, 2013 by user2959726 • edited Nov 12, 2013 by Jens Kloster

3 Answers

0

this is your problem, your 3rd party component:

'Gizmox.WebGUI.Forms.Form'

uninstall it and reinstall it. one way or another, this component is the culprit

answered on Stack Overflow Nov 12, 2013 by Ahmed ilyas
0

From this error: ... for your current platform or Any CPU.

Your project and Gizmox.WebGUI project library probably have been compiled with different platform setting, x86, Any CPU, Mixed Platform or x64.

Whatever it is make sure all projects have the same platform settings. Click Menu: Build > Configuration Manager and set all to the same platform. If Gizmo is already compiled and only as reference then find the platform it was built.

Compile all, close designer and open again.

answered on Stack Overflow Nov 12, 2013 by Yohanes Nurcahyo
-1

Since OP prolly isn't still worrying about this, i will give my fix for all of the googlers.

I mainly got this error after deleting something like this from my code:

private void button1_Click(object sender, EventArgs e){
...}

And it would get all mad, because in the Form1.Designer.cs it would have something like this:

this.button1.Click += new System.EventHandler(this.button1_Click);

All it takes to fix this error(at least when i encounter it), is to delete the line from Form1.Designer.cs

answered on Stack Overflow Mar 25, 2014 by Margamel

User contributions licensed under CC BY-SA 3.0