C
C#5mo ago
5124

Visual Studio 2022 winforms problem

Eror: CS1061
private void btn_Giris_Click(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(txt_KullaniciAdi.Text))
{

using (WisdifyData data = new WisdifyData())
{
Kullanici kullanici = data.kullaniciAl(txt_KullaniciAdi.Text);

if (kullanici != null)
{
Menu me = new Menu(kullanici); // ### Problemm CS0144
me.Show(); // ### Problemm CS1061

}
else
{
MessageBox.Show("Kullanıcı adına sahip bir kişi bulunamadı.", "Bulunamadı", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
else
{
MessageBox.Show("Lütfen boş bırakmayınız.","Uyarı",MessageBoxButtons.OK,MessageBoxIcon.Warning);
}
}
private void btn_Giris_Click(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(txt_KullaniciAdi.Text))
{

using (WisdifyData data = new WisdifyData())
{
Kullanici kullanici = data.kullaniciAl(txt_KullaniciAdi.Text);

if (kullanici != null)
{
Menu me = new Menu(kullanici); // ### Problemm CS0144
me.Show(); // ### Problemm CS1061

}
else
{
MessageBox.Show("Kullanıcı adına sahip bir kişi bulunamadı.", "Bulunamadı", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
else
{
MessageBox.Show("Lütfen boş bırakmayınız.","Uyarı",MessageBoxButtons.OK,MessageBoxIcon.Warning);
}
}
I wrote the error code numbers in the code, I couldn't find a solution
14 Replies
Angius
Angius5mo ago
I don't remember all error codes by hearth. I don't think anybody does, actually So what are CS0144 and CS1061?
5124
51245mo ago
Excuse me, you wouldn't understand it even if I threw it because my IDE is in Turkish, now I'm sending the official error message: CS1061 : 'type' does not contain a definition for 'name' and no accessible extension method 'name' accepting a first argument of type 'type' could be found (are you missing a using directive or an assembly reference?). CS0144 : Cannot create an instance of the abstract class or interface 'interface'
Angius
Angius5mo ago
They seem pretty obvious Menu is an abstract class or an interface, and those cannot be instantiated And whatever Menu is, it has no method named Show()
5124
51245mo ago
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Wisdify.Sınıflar;

namespace Wisdify.Formlar
{
public partial class Menu : Form
{
Kullanici kullanici;
public Menu( Kullanici _kullanici)
{
InitializeComponent();
kullanici = _kullanici;
}

private void Menu_Load(object sender, EventArgs e)
{

}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Wisdify.Sınıflar;

namespace Wisdify.Formlar
{
public partial class Menu : Form
{
Kullanici kullanici;
public Menu( Kullanici _kullanici)
{
InitializeComponent();
kullanici = _kullanici;
}

private void Menu_Load(object sender, EventArgs e)
{

}
}
}
menu.cs (form) I didn't understand the menu I created as a Windows form and I didn't understand why the error was caused by everything is correct from my point of view but I don't know I must have a small mistake somewhere, when I opened another form for the experiment, it worked fine before I took any form settings, unfortunately the errors did not leave me when I came back to this project
Angius
Angius5mo ago
Why is it partial? It could be that another partial Menu class exists, and this one is abstract So in total you get an abstract Menu class
MODiX
MODiX5mo ago
Angius
REPL Result: Failure
// This hides somewhere in your project
abstract partial class Menu { }

// This is what you showed above
partial class Menu { }

// Which makes the whole thing abstract and thus, impossible to instantiate
new Menu();
// This hides somewhere in your project
abstract partial class Menu { }

// This is what you showed above
partial class Menu { }

// Which makes the whole thing abstract and thus, impossible to instantiate
new Menu();
Exception: CompilationErrorException
- Cannot create an instance of the abstract type or interface 'Menu'
- Cannot create an instance of the abstract type or interface 'Menu'
Compile: 233.367ms | Execution: 0.000ms | React with ❌ to remove this embed.
5124
51245mo ago
@ZZZZZZZZZZZZZZZZZZZZZZZZZ Shouldn't it be partial, it's a winform, and as far as I know, all forms are partial.
Angius
Angius5mo ago
Are they? Never worked much with Winforms so maybe
5124
51245mo ago
Yes, they are all partisan
Angius
Angius5mo ago
No idea, then
5124
51245mo ago
😦 My friend, I solved it, at the end of 2 days, it turns out that with the new update, there is a feature called Menu, a class called Visual A Menu has come, so the two overlap @ZZZZZZZZZZZZZZZZZZZZZZZZZ
Angius
Angius5mo ago
Ah, makes sense Glad you solved it!
abdulrauf6514
abdulrauf65144mo ago
how to upgrade visual studio 2017 to 2022 i have 2022 in my other laptop but in this machine i have windows 10 and vs 2017 version.
Angius
Angius4mo ago
Just uninstall 2017 and install 2022 Or just install 2022, they can exist besides eachother
Want results from more Discord servers?
Add your server
More Posts
Combine string formatting (eg `$"{number:N2}" with D2) so like `{number:N2D2}`)You have string interpolation like $"{number:N2}", how can I combine formats? Like $"{number:N2D2}".NET MAUI Android Error: Type androidx.collection.ArrayMapKit is defined multiple timesthis error happens to me when i download firebase storage or firebase firestore plugins. New projectI'm getting "specified method is not supported" when I include a specific navigation property with eI'm using ASP.NET Core Identity with a custom IdentityUser that looks like this: public class AppliIs there a way to authenticate using OAuth2 token and map it to internal JWTBasically, my server checks for some stuff by utilizing OAuth2 token and returns JWT Im looking for Beginner question. what does this createhostbuilder do?I'm learning .net core and I saw this code in program.cs. I can understand the main method calls thiim creating a game in unity for school, and need some help with a script errorso the purpose of the script is to freeze the character in place and block all inputs when "p" is prFile writingAnyone know a way around or how to fix this? none of my previous practice apps have come up with thican some xpalin why in LinqIn linquo querys i need to. use the word Select(p => new) what dose new mean i dont want to create aIndex in C#Can someone just explain to me how i solve this problem. i have made a code with two machines and imi need help with one exercise using cyclesJack wanted to plant hyacinths. Hyacinth bulbs of N different colours were available on the market,