C sharp - "InitializeComponent" tiene error de un proyecto migrado

 
Vista:

"InitializeComponent" tiene error de un proyecto migrado

Publicado por Diego (2 intervenciones) el 11/03/2023 17:29:09
Hola a todos:

Es un proyecto migrado y cuando llamo al diseñador no inicializa y da el siguiente error:

No se pudo analizar el método "InitializeComponent". El analizador informó del siguiente error "Invalid symbol kind: NamedType". Busque posibles errores en la lista de tareas.

El modulo "InitializeComponent" es este:


private void InitializeComponent()
{
this.components = (IContainer) new System.ComponentModel.Container();
this.TiempoEspera = new Timer(this.components);
this.EqtMensaje = new Label();
this.Imagen = new PictureBox();
this.BtnAceptar = new Button();
this.EqtEspera = new Label();
((ISupportInitialize) this.Imagen).BeginInit();
this.SuspendLayout();
this.TiempoEspera.Interval = 1;
this.EqtMensaje.AutoSize = true;
this.EqtMensaje.BackColor = Color.Transparent;
this.EqtMensaje.Cursor = Cursors.Default;
this.EqtMensaje.Font = new Font("Arial", 8f, FontStyle.Bold, GraphicsUnit.Point, (byte) 0);
this.EqtMensaje.ForeColor = SystemColors.ControlText;
Label eqtMensaje1 = this.EqtMensaje;
Point point1 = new Point(72, 20);
Point point2 = point1;
eqtMensaje1.Location = point2;
this.EqtMensaje.Name = "EqtMensaje";
this.EqtMensaje.RightToLeft = RightToLeft.No;
Label eqtMensaje2 = this.EqtMensaje;
Size size1 = new Size(0, 14);
Size size2 = size1;
eqtMensaje2.Size = size2;
this.EqtMensaje.TabIndex = 2;
this.Imagen.BackColor = Color.Transparent;
this.Imagen.BackgroundImageLayout = ImageLayout.Stretch;
this.Imagen.Cursor = Cursors.Default;
PictureBox imagen1 = this.Imagen;
point1 = new Point(16, 24);
Point point3 = point1;
imagen1.Location = point3;
this.Imagen.Name = "Imagen";
PictureBox imagen2 = this.Imagen;
size1 = new Size(33, 33);
Size size3 = size1;
imagen2.Size = size3;
this.Imagen.SizeMode = PictureBoxSizeMode.StretchImage;
this.Imagen.TabIndex = 3;
this.Imagen.TabStop = false;
this.BtnAceptar.BackColor = SystemColors.Control;
this.BtnAceptar.Cursor = Cursors.Default;
this.BtnAceptar.Font = new Font("Arial", 8f, FontStyle.Regular, GraphicsUnit.Point, (byte) 0);
this.BtnAceptar.ForeColor = SystemColors.ControlText;
Button btnAceptar1 = this.BtnAceptar;
point1 = new Point(115, 62);
Point point4 = point1;
btnAceptar1.Location = point4;
this.BtnAceptar.Name = "BtnAceptar";
this.BtnAceptar.RightToLeft = RightToLeft.No;
Button btnAceptar2 = this.BtnAceptar;
size1 = new Size(89, 33);
Size size4 = size1;
btnAceptar2.Size = size4;
this.BtnAceptar.TabIndex = 4;
this.BtnAceptar.Text = "Aceptar";
this.BtnAceptar.UseVisualStyleBackColor = false;
this.EqtEspera.BackColor = Color.Transparent;
this.EqtEspera.Cursor = Cursors.Default;
this.EqtEspera.Font = new Font("Arial", 8f, FontStyle.Bold, GraphicsUnit.Point, (byte) 0);
this.EqtEspera.ForeColor = SystemColors.ControlText;
Label eqtEspera1 = this.EqtEspera;
point1 = new Point(115, 96);
Point point5 = point1;
eqtEspera1.Location = point5;
this.EqtEspera.Name = "EqtEspera";
this.EqtEspera.RightToLeft = RightToLeft.No;
Label eqtEspera2 = this.EqtEspera;
size1 = new Size(89, 13);
Size size5 = size1;
eqtEspera2.Size = size5;
this.EqtEspera.TabIndex = 5;
this.EqtEspera.Text = "Esperar";
this.EqtEspera.TextAlign = ContentAlignment.TopCenter;
this.EqtEspera.Visible = false;
this.AcceptButton = (IButtonControl) this.BtnAceptar;
size1 = new Size(5, 13);
this.AutoScaleBaseSize = size1;
this.BackColor = SystemColors.Control;
this.BackgroundImageLayout = ImageLayout.Stretch;
size1 = new Size(312, 122);
this.ClientSize = size1;
this.Controls.Add((Control) this.BtnAceptar);
this.Controls.Add((Control) this.EqtEspera);
this.Controls.Add((Control) this.EqtMensaje);
this.Controls.Add((Control) this.Imagen);
this.Cursor = Cursors.Default;
this.Font = new Font("Arial", 8f, FontStyle.Regular, GraphicsUnit.Point, (byte) 0);
this.FormBorderStyle = FormBorderStyle.FixedDialog;
point1 = new Point((int) byte.MaxValue, 29);
this.Location = point1;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = nameof (Mensaje);
//this.Name = "Mensaje";
this.RightToLeft = RightToLeft.No;
this.ShowInTaskbar = false;
this.StartPosition = FormStartPosition.CenterScreen;
this.Text = "Mensaje TrucoTec 2011";
((ISupportInitialize) this.Imagen).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}

¿Donde esta el error? Gracias de antemano.

Saludos
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

"InitializeComponent" tiene error de un proyecto migrado

Publicado por Diego (2 intervenciones) el 13/03/2023 16:22:03
Hola:

Seguí viendo el código y parece que tiene que ver con esta linea:

this.Name = nameof (Mensaje);

Saqué todos los controles, y saqué esa linea, y el diseño dibuja todo, sino, no. Pero con los controles esa linea es necesaria, sino dá varios errores mas.

Saludos y gracias de antemano!
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar