Amir
Amir
CC#
Created by Amir on 10/17/2024 in #help
✅ Winforms not freeing memory when disposing of control
void NewButtonOnClick(Button btn)
{
//Delete the button completely, write code
btn.Parent.Controls.Remove(btn);
btn.Dispose();
btn = null;
}
void NewButtonOnClick(Button btn)
{
//Delete the button completely, write code
btn.Parent.Controls.Remove(btn);
btn.Dispose();
btn = null;
}
The memory usage continues going up
23 replies
CC#
Created by Amir on 1/11/2024 in #help
MSB4025: The project file could not be loaded. Data at the root level is invalid. Line 1, position 1
I'm running this file test.cs using the terminal but i keep getting the error MSB4025: The project file could not be loaded. Data at the root level is invalid. Line 1, position 1
using System;

namespace FavoriteNumber
{
class Program
{
static void Main(string[] args)
{
// Ask user for favorite number
int favNumber;
Console.Write("Enter your favorite number: ");

// Turn the answer into an int
favNumber = Convert.ToInt32(Console.ReadLine());
Console.WriteLine($"Your favorite number is {favNumber}!");
}
}
}
using System;

namespace FavoriteNumber
{
class Program
{
static void Main(string[] args)
{
// Ask user for favorite number
int favNumber;
Console.Write("Enter your favorite number: ");

// Turn the answer into an int
favNumber = Convert.ToInt32(Console.ReadLine());
Console.WriteLine($"Your favorite number is {favNumber}!");
}
}
}
9 replies