public class MainActivity : Activity
{
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
SetContentView(Resource.Layout.Main);
EditText val1 = FindViewById<EditText>(Resource.Id.txtuser1);
EditText val2 = FindViewById<EditText>(Resource.Id.txtuser2);
Error :
The name 'Resource' does not exist in the current context.
I was facing the same issue today in my Xamarin
application. I tried the following things
obj
and bin
folder and rebuild the projectNone of the above things worked for me. The real issue was because of that the file Resource.Designer.cs
was excluded from my project and including that to the solution fixed the issue for me.
Hope it helps
I was so resolved (by visual studio)
Remove 3 line
SetContentView(Resource.Layout.Main);
EditText val1 = FindViewById<EditText>(Resource.Id.txtuser1);
EditText val2 = FindViewById<EditText>(Resource.Id.txtuser2);
Build -> Clean
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With