Whats’ in a name?

You are working on your app and you realize that Test233 is not a great name for an app, so how do you change it. Just rename the file? Not quite.

You can select the project in Visual Studio and chose the rename function, but this is only the start. Next is to go through and do a replace of the old name with the new in the code. Visual Studio was nice enough in the beginning to take the name you originally chose and nicely placed it around your project. Places like the namespace. If you leave the app and find the sln file, it still has the old name. Normally the *.sln and *.suo files are in a folder with a similarly named folder that contains the solution. Rather than the obvious of renaming the files, delete the *.sln and the *.suo file and open the solution folder and find *.csproj file (You did remember to do a backup BEFORE attemting this?) Click on it and start Visual Studio. Change one of the files and then save. Visual Studio will nicely recreate the solution file with the proper name and let you select where you want it placed. Usually back up one level where the original was.

The next step is to make sure the Project properties are set to use the new name and NameSpace.

Now run the app and it …. crashes? Verify the Startup object is correct.

Any guesses on what I was doing for the past hour?   This is not the definitive explanation, but that is what I needed to do and I was caught by not having a Startup object.

John Marshall… Visio MVP       Visio.MVPs.org

Published by johnvisiomvp

The original Visio MVP. I have worked with the Visio team since 1993