Comment puis-je résoudre cette forme d’erreur ?

la programmation


C#
namespace Skills_International
{
    public partial class Form1 : Form
    {
        private object txtpassword;
        private object txtpassword;

        public Form1()
        {
            InitializeComponent();
        }

Instances de cette erreur (1)

1.   Skills International Form1.Designer.cs Line:35 Column:1   Show Call Stack  
 
at Microsoft.DotNet.DesignTools.Client.CodeDom.Roslyn.CSharp.CSharpCodeDomService.Reader.AddMethod(MethodDeclarationSyntax methodDeclaration, CodeTypeMemberCollection collection)
at Microsoft.DotNet.DesignTools.Client.CodeDom.Roslyn.CSharp.CSharpCodeDomService.Reader.AddClass(ClassDeclarationSyntax classDeclaration, IList collection)
at Microsoft.DotNet.DesignTools.Client.CodeDom.Roslyn.CSharp.CSharpCodeDomService.Reader.AddNamespace(BaseNamespaceDeclarationSyntax namespaceDeclaration, CodeNamespaceCollection collection)
at Microsoft.DotNet.DesignTools.Client.CodeDom.Roslyn.CSharp.CSharpCodeDomService.Reader.Read()
at Microsoft.DotNet.DesignTools.Client.CodeDom.Roslyn.RoslynCodeDomService.d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.DotNet.DesignTools.Client.CodeDom.Roslyn.RoslynCodeDomService.d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.DotNet.DesignTools.Client.CodeDom.CodeDomSource.d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.DotNet.DesignTools.Client.CodeDom.CodeDomSource.d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.DotNet.DesignTools.Client.CodeDom.CodeDomManager.d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.DotNet.DesignTools.Client.CodeDom.CodeDomManager.d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.DotNet.DesignTools.Client.Loader.VsDesignerLoader.d__59.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.DotNet.DesignTools.Client.Loader.VsDesignerLoader.<>c__DisplayClass57_0.<b__1>d.MoveNext()

Aide avec cette erreur

Aide MSDN

Messages du forum concernant cette erreur

Recherchez sur les forums MSDN les messages liés à cette erreur

Ce que j’ai essayé :

J’ai essayé les codes ci-dessus mais j’obtiens toujours le nom d’utilisateur txt et le mot de passe txt comme erreur

Solution 1

Sans accès à votre système, nous ne pouvons pas vraiment vous aider : il y a trop peu d’informations disponibles pour être précis.
Cependant, puisque cela semble être votre cas Form1.cs fichier, il est très probable que les deux lignes que vous avez ajoutées soient à l’origine du problème – commentez ces lignes et voyez si l’erreur disparaît :

private object txtpassword;
private object txtpassword;

Pourquoi avez-vous deux variables portant le même nom, pourquoi sont-elles déclarées comme object valeurs et le préfixe “txt” indique généralement une TextBox – ce qui signifie qu’ils peuvent déjà exister sur votre formulaire en tant que contrôles TextBox – auquel cas les nouveaux noms entreront également en conflit avec ceux que le système a ajoutés au Form1.designer.cs fichier qu’il conserve et utilise pour afficher le formulaire en mode Création.

コメント

タイトルとURLをコピーしました