I've created a program with some very big .cs files. So i tried to split one of them up by using partial classes. So i created a second file with same class name inside and same namespace. I cut some functions from one file and pasted it in the second one. But when i want to run the program it says that the class already exists. But its a partial class it has to have the same name :S
At the first file (ChartWidget.cs) it starts with:
namespace UGS.Sidebar.ChartWidget
{
public partial class ChartWidget : UserControl
{
#region declarations
private int id = -1;
.....
At the second file (Debugging.cs) it starts with:
namespace UGS.Sidebar.ChartWidget
{
public partial class ChartWidget : UserControl
{
#region debugvars
Random _r = new Random();
#endregion
.....
those files are from an Usercontrol (as you can see) but i dont think that this is the problem?
Hope you guys can tell me why it doesnt work :( And sorry for my bad english i really suck ... :)
Check you haven't appended the class name on to the end of a namespace. e.g. if you put your new class into a folder of the same name, it will automatically get suffixed on the namespace name
No need to inherit from UserControl in second class
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