Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C#
namespace Skills_International
{
    public partial class Form1 : Form
    {
        private object txtpassword;
        private object txtpassword;

        public Form1()
        {
            InitializeComponent();
        }


Instances of this error (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()

Help with this error

MSDN Help



Forum posts about this error

Search the MSDN Forums for posts related to this error

What I have tried:

I have tried the above codes but still i do get the txtusername and txtpassword as an error
Posted
Updated 30-Dec-23 3:54am
v2
Comments
Richard MacCutchan 30-Dec-23 7:46am    
What is the error message, and where is line 35?
Jegan Saumiya 30-Dec-23 21:05pm    
txtpassword = new TextBox();
txtusername = new TextBox();
line 35
Jegan Saumiya 30-Dec-23 21:00pm    
txtusername and txtpassword shows an error message with a code of CS0229
Richard MacCutchan 31-Dec-23 3:31am    
Please stop writing as little as possible. Show us the actual code in its proper context, and the complete text of all error messages.

1 solution

Without access to your system, we can't really help you - there is far too little info available to be specific.
However, since that appears to by your Form1.cs file, it's very likely that the two lines you added are causing the problem - comment out these lines and see if the error goes away:
private object txtpassword;
private object txtpassword;
Why do you have two variables with the same name, why are they declared as object values, and the prefix "txt" generally indicates a TextBox - which means they may already exist on your form as TextBox controls - in which case the new names will also conflict with those the system added to the Form1.designer.cs file that it maintains and uses to display the form in Design View.
 
Share this answer
 
Comments
Jegan Saumiya 30-Dec-23 20:58pm    
how can i provide access to my project inorder to solve the error?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900