0

I am new to C#. I have created an application in C# (connecting to Teradata database)that I named it as windowsformapplication2 (the default that comes). But, now I want to change the name to a meaningful name(CPU_Scoring). I have tried to rename project and solution, but I see the components in 'bin' are the same. When I run my application, it runs as windowsformapplication2 not` CPU_Scoring. Is there was way to do this, or do I have to create my application again ?

Mohit S
  • 13,723
  • 6
  • 34
  • 69
Samir Singh
  • 41
  • 1
  • 1
  • 5
  • You need to change the assembly name. Right click your project, go to properties. Click `Application` on the left, and then change 'Assembly Name' (and probably default namespace too). – Rob Dec 21 '15 at 01:07
  • 3
    Project > Properties. Spend an half hour looking what is there, press F1 if you don't understand something. – Hans Passant Dec 21 '15 at 01:07

1 Answers1

2

In Visual Studio

  • In Solution Explorer, right click on Main solution > Rename
  • In Solution Explorer, right click on project (under solution) > Rename
  • In Solution Explorer, double click, or right click on Properties > Application Tab, rename Assembly name and Default namespace to match.
  • Also rename the namespace, Open one of your class files. Right click the namespace > Rename... this should search and replace all references to your namespace throughout the project.
  • Close the project > rename the project folder.
  • Edit .sln file in notepad, change the path to the cjproj. ie
    windowsformapplication2\bar.csproj --> CPU_Scoring\bar.csproj

You might also like to have a look on Proper way to rename solution (and directories) in Visual Studio

Community
  • 1
  • 1
Mohit S
  • 13,723
  • 6
  • 34
  • 69