Laden...

Visual Studio 2008 stürzt beim Hinzufügen von ToolStripButtons ab

Erstellt von punkdevil vor 14 Jahren Letzter Beitrag vor 14 Jahren 2.527 Views
P
punkdevil Themenstarter:in
992 Beiträge seit 2007
vor 14 Jahren
Visual Studio 2008 stürzt beim Hinzufügen von ToolStripButtons ab

Hallo,

ich habe ine prolbme mit meinem Visual Studio 2008.

Ich habe eine Form mit einem Toolstrip. Darin habe ich 4 ToolStripButtons. Diese habe ich vor längerer Zeit erstellt.

Nun möchte ich einen Weitern Button hinzufügen. Das funktioniert auch. Wenn ich aber nun mit der rechten Muastatste auf den ToolStripButton klicke und auf "Bild festlegen ..." klicke, stürzt Visual Studio ab.
Gehe ich über das PropertyGrid Eigenschaften und versuche ein Image auszuwählen kommt die Fehlermeldung "Ein Element mit dem gleichen Schlüssel wurde bereits hinzugefügt" und ich kann dann kein Image auswählen,.

ich habe auch den Button beretits gelöscht und wieder neu angelegt, dass Verhalten ist das gleiche.

Dann hab ich versucht bei einem der älteren Buttons das Image zu ändern und das geht auch nicht mehr.

Hat jemand eine Idee woran das liegt?

Danke!

C
116 Beiträge seit 2004
vor 14 Jahren

Die Eigenschaft wurde scheinbar intern schon gesetzt und danach ist dein Visual Studio abgestürzt. Schau dir mal die Designer Datei im SourceCode an, da findest du deine getätigte Einstellung. Bezüglich des Absturzes, schau dir mal die Event-Log deines Computers an.

60 Beiträge seit 2008
vor 14 Jahren

Hast Du das SP1 für VS2008 eingespielt?
Notfalls mal die Settings zurücksetzen (devenv.exe /resetsettings).

S.

P
punkdevil Themenstarter:in
992 Beiträge seit 2007
vor 14 Jahren

In der Designerdatei finde ich nichts, was ich ändern sollte damit das Problem behoben wird:


/// <summary>
    /// Hauptformular
    /// </summary>
    partial class FormMain
    {
        /// <summary>
        /// Erforderliche Designervariable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Verwendete Ressourcen bereinigen.
        /// </summary>
        /// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Vom Windows Form-Designer generierter Code

        /// <summary>
        /// Erforderliche Methode für die Designerunterstützung.
        /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormMain));
            this.ToolStripContainer = new System.Windows.Forms.ToolStripContainer();
            this.StatusStrip = new System.Windows.Forms.StatusStrip();
            this.m_StatusLabelInfo = new System.Windows.Forms.ToolStripStatusLabel();
            this.ToolStrip = new System.Windows.Forms.ToolStrip();
            this.btnSave = new System.Windows.Forms.ToolStripButton();
            this.m_btnServices = new System.Windows.Forms.ToolStripButton();
            this.m_BtnBasicSettings = new System.Windows.Forms.ToolStripButton();
            this.m_BtnAdvancedSettings = new System.Windows.Forms.ToolStripButton();
            this.m_ImageList = new System.Windows.Forms.ImageList(this.components);
            this.ToolStripContainer.BottomToolStripPanel.SuspendLayout();
            this.ToolStripContainer.TopToolStripPanel.SuspendLayout();
            this.ToolStripContainer.SuspendLayout();
            this.StatusStrip.SuspendLayout();
            this.ToolStrip.SuspendLayout();
            this.SuspendLayout();
            // 
            // ToolStripContainer
            // 
            this.ToolStripContainer.AccessibleDescription = null;
            this.ToolStripContainer.AccessibleName = null;
            resources.ApplyResources(this.ToolStripContainer, "ToolStripContainer");
            // 
            // ToolStripContainer.BottomToolStripPanel
            // 
            this.ToolStripContainer.BottomToolStripPanel.AccessibleDescription = null;
            this.ToolStripContainer.BottomToolStripPanel.AccessibleName = null;
            this.ToolStripContainer.BottomToolStripPanel.BackgroundImage = null;
            resources.ApplyResources(this.ToolStripContainer.BottomToolStripPanel, "ToolStripContainer.BottomToolStripPanel");
            this.ToolStripContainer.BottomToolStripPanel.Controls.Add(this.StatusStrip);
            this.ToolStripContainer.BottomToolStripPanel.Font = null;
            // 
            // ToolStripContainer.ContentPanel
            // 
            this.ToolStripContainer.ContentPanel.AccessibleDescription = null;
            this.ToolStripContainer.ContentPanel.AccessibleName = null;
            resources.ApplyResources(this.ToolStripContainer.ContentPanel, "ToolStripContainer.ContentPanel");
            this.ToolStripContainer.ContentPanel.BackgroundImage = null;
            this.ToolStripContainer.ContentPanel.Font = null;
            this.ToolStripContainer.Font = null;
            // 
            // ToolStripContainer.LeftToolStripPanel
            // 
            this.ToolStripContainer.LeftToolStripPanel.AccessibleDescription = null;
            this.ToolStripContainer.LeftToolStripPanel.AccessibleName = null;
            this.ToolStripContainer.LeftToolStripPanel.BackgroundImage = null;
            resources.ApplyResources(this.ToolStripContainer.LeftToolStripPanel, "ToolStripContainer.LeftToolStripPanel");
            this.ToolStripContainer.LeftToolStripPanel.Font = null;
            this.ToolStripContainer.Name = "ToolStripContainer";
            // 
            // ToolStripContainer.RightToolStripPanel
            // 
            this.ToolStripContainer.RightToolStripPanel.AccessibleDescription = null;
            this.ToolStripContainer.RightToolStripPanel.AccessibleName = null;
            this.ToolStripContainer.RightToolStripPanel.BackgroundImage = null;
            resources.ApplyResources(this.ToolStripContainer.RightToolStripPanel, "ToolStripContainer.RightToolStripPanel");
            this.ToolStripContainer.RightToolStripPanel.Font = null;
            // 
            // ToolStripContainer.TopToolStripPanel
            // 
            this.ToolStripContainer.TopToolStripPanel.AccessibleDescription = null;
            this.ToolStripContainer.TopToolStripPanel.AccessibleName = null;
            this.ToolStripContainer.TopToolStripPanel.BackgroundImage = null;
            resources.ApplyResources(this.ToolStripContainer.TopToolStripPanel, "ToolStripContainer.TopToolStripPanel");
            this.ToolStripContainer.TopToolStripPanel.Controls.Add(this.ToolStrip);
            this.ToolStripContainer.TopToolStripPanel.Font = null;
            // 
            // StatusStrip
            // 
            this.StatusStrip.AccessibleDescription = null;
            this.StatusStrip.AccessibleName = null;
            resources.ApplyResources(this.StatusStrip, "StatusStrip");
            this.StatusStrip.BackgroundImage = null;
            this.StatusStrip.Font = null;
            this.StatusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.m_StatusLabelInfo});
            this.StatusStrip.Name = "StatusStrip";
            // 
            // m_StatusLabelInfo
            // 
            this.m_StatusLabelInfo.AccessibleDescription = null;
            this.m_StatusLabelInfo.AccessibleName = null;
            resources.ApplyResources(this.m_StatusLabelInfo, "m_StatusLabelInfo");
            this.m_StatusLabelInfo.BackgroundImage = null;
            this.m_StatusLabelInfo.Name = "m_StatusLabelInfo";
            // 
            // ToolStrip
            // 
            this.ToolStrip.AccessibleDescription = null;
            this.ToolStrip.AccessibleName = null;
            resources.ApplyResources(this.ToolStrip, "ToolStrip");
            this.ToolStrip.BackgroundImage = null;
            this.ToolStrip.Font = null;
            this.ToolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.btnSave,
            this.m_btnServices,
            this.m_BtnBasicSettings,
            this.m_BtnAdvancedSettings});
            this.ToolStrip.Name = "ToolStrip";
            this.ToolStrip.Stretch = true;
            // 
            // btnSave
            // 
            this.btnSave.AccessibleDescription = null;
            this.btnSave.AccessibleName = null;
            resources.ApplyResources(this.btnSave, "btnSave");
            this.btnSave.BackgroundImage = null;
            this.btnSave.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
            this.btnSave.Name = "btnSave";
            this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
            // 
            // m_btnServices
            // 
            this.m_btnServices.AccessibleDescription = null;
            this.m_btnServices.AccessibleName = null;
            resources.ApplyResources(this.m_btnServices, "m_btnServices");
            this.m_btnServices.BackgroundImage = null;
            this.m_btnServices.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
            this.m_btnServices.Name = "m_btnServices";
            this.m_btnServices.Click += new System.EventHandler(this.m_btnServices_Click);
            // 
            // m_BtnBasicSettings
            // 
            this.m_BtnBasicSettings.AccessibleDescription = null;
            this.m_BtnBasicSettings.AccessibleName = null;
            resources.ApplyResources(this.m_BtnBasicSettings, "m_BtnBasicSettings");
            this.m_BtnBasicSettings.BackgroundImage = null;
            this.m_BtnBasicSettings.Checked = true;
            this.m_BtnBasicSettings.CheckOnClick = true;
            this.m_BtnBasicSettings.CheckState = System.Windows.Forms.CheckState.Checked;
            this.m_BtnBasicSettings.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
            this.m_BtnBasicSettings.Name = "m_BtnBasicSettings";
            this.m_BtnBasicSettings.Click += new System.EventHandler(this.m_BtnBasicSettings_Click);
            // 
            // m_BtnAdvancedSettings
            // 
            this.m_BtnAdvancedSettings.AccessibleDescription = null;
            this.m_BtnAdvancedSettings.AccessibleName = null;
            resources.ApplyResources(this.m_BtnAdvancedSettings, "m_BtnAdvancedSettings");
            this.m_BtnAdvancedSettings.BackgroundImage = null;
            this.m_BtnAdvancedSettings.CheckOnClick = true;
            this.m_BtnAdvancedSettings.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
            this.m_BtnAdvancedSettings.Name = "m_BtnAdvancedSettings";
            this.m_BtnAdvancedSettings.Click += new System.EventHandler(this.m_BtnAdvancedSettings_Click);
            // 
            // m_ImageList
            // 
            this.m_ImageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("m_ImageList.ImageStream")));
            this.m_ImageList.TransparentColor = System.Drawing.Color.Transparent;
            this.m_ImageList.Images.SetKeyName(0, "Flag_greenHS.png");
            this.m_ImageList.Images.SetKeyName(1, "Flag_redHS.png");
            // 
            // FormMain
            // 
            this.AccessibleDescription = null;
            this.AccessibleName = null;
            resources.ApplyResources(this, "$this");
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.BackgroundImage = null;
            this.Controls.Add(this.ToolStripContainer);
            this.DoubleBuffered = true;
            this.Font = null;
            this.Name = "FormMain";
            this.Load += new System.EventHandler(this.FormMain_Load);
            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FormMain_FormClosing);
            this.ToolStripContainer.BottomToolStripPanel.ResumeLayout(false);
            this.ToolStripContainer.BottomToolStripPanel.PerformLayout();
            this.ToolStripContainer.TopToolStripPanel.ResumeLayout(false);
            this.ToolStripContainer.TopToolStripPanel.PerformLayout();
            this.ToolStripContainer.ResumeLayout(false);
            this.ToolStripContainer.PerformLayout();
            this.StatusStrip.ResumeLayout(false);
            this.StatusStrip.PerformLayout();
            this.ToolStrip.ResumeLayout(false);
            this.ToolStrip.PerformLayout();
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.ToolStripContainer ToolStripContainer;
        private System.Windows.Forms.StatusStrip StatusStrip;
        private System.Windows.Forms.ToolStrip ToolStrip;
        private System.Windows.Forms.ToolStripButton btnSave;
        private System.Windows.Forms.ToolStripStatusLabel m_StatusLabelInfo;
        public System.Windows.Forms.ImageList m_ImageList;
        private System.Windows.Forms.ToolStripButton m_btnServices;
        private System.Windows.Forms.ToolStripButton m_BtnBasicSettings;
        private System.Windows.Forms.ToolStripButton m_BtnAdvancedSettings;        
    }

Im Eventlog steht folgendes:

.NET Runtime version 2.0.50727.3607 - Schwerwiegender Fehler im Ausführungsmodul (7A2E10D2) (0).

EventType clr20r3, P1 devenv.exe, P2 9.0.30729.1, P3 488f2b50, P4 mscorlib, P5 2.0.0.0, P6 4add54dc, P7 dd, P8 10, P9 system.argumentexception, P10 NIL.

Servicepack ist drauf, die Settings habe ich nicht zurückgesetzt, da ich es bei einem anderen Projekt funktioniert...

C
116 Beiträge seit 2004
vor 14 Jahren
            // 
            // m_ImageList
            // 
            this.m_ImageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("m_ImageList.ImageStream")));
            this.m_ImageList.TransparentColor = System.Drawing.Color.Transparent;
            this.m_ImageList.Images.SetKeyName(0, "Flag_greenHS.png");
            this.m_ImageList.Images.SetKeyName(1, "Flag_redHS.png");

Das einzige was mir auffallen würde, wäre dieser Bereich, das er meckert, dass der Schlüssel bereits vorkommt.

P
punkdevil Themenstarter:in
992 Beiträge seit 2007
vor 14 Jahren

Hallo Counterfeit,

ich habe jetzt die ImageList entfernt, das Verhalten ist aber das gleiche.

P
punkdevil Themenstarter:in
992 Beiträge seit 2007
vor 14 Jahren

Ich habe es jetzt gefunden.

Ich hatte in meinem Projekt eine Resourcedatei mit dem Namen Resources hinzugefügt. Allerdings gab es bereits eine Datei Resources.resx unter Properties.
Nachdem ich meine manuelle hinzugefügte Resources.resx aus dem Projekt rausgenommen habe, ging es wieder.