I have a VB.NET project in Visual Studio 2010 for an Excel Add-In.
I use the "My" namespace, and in general it seems that the "My Project" folder contains configuration information about the project.
My problem is that I need to change the name of this folder, because my version manager system won't accept spaces in file or folder names.
Is it possible? If yes, how?
Edit: There is a hacky way to do it, by renaming the folder and changing all references in the .vbproj file. However, the may work for a command line generation, but it won't work the next time the project will be opened in Visual Studio. The IDE will create a new "My Project" folder, and complain that it can't find the settings in it.
I'm looking for a way to rename it so that Visual Studio would accept it correctly.
Rename the folder (s) outside Visual Studio. Open the solution in Visual Studio, ignoring the warnings. Go through all unavailable projects and click “F4” key view project properties. Set the file path to the new folder location. Right-click > Reload project. Change the display name of the project. Right-click > Rename.
In Visual Studio, select menu File► Open Project. Drill into the new folder you just renamed and open the .csproj file (located in the child folder). Right-click the project name and rename it to what you want.
Move the Project folder to its new location (don't rename anything yet) In Solution Explorer, rename the Project / Solution. Close (and save) the newly-renamed project.
Rename the folder (s) outside Visual Studio. Open the solution in Visual Studio, ignoring the warnings. Go through all unavailable projects and click “F4” key view project properties. Set the file path to the new folder location. Right-click > Reload project.
In fact it is possible, but seems to be undocumented.
Open the project file (*.vbproj) in a text editor, and add the following line inside the first <PropertyGroup>
element:
<AppDesignerFolder>NewName</AppDesignerFolder>
Now when Visual Studio regenerates the folder, it will call it "NewName", and anything it generates that it would put in My Project (such as AssemblyInfo.vb) will be put there.
You can then move (in Explorer, not Visual Studio) the contents of "My Project" to that folder, delete "My Project", and everything should work as expected.
The „My Project“ convention is part of Visual Studios project and item templates and although you can change them, I wouldn’t do it. It’s not just changing one project template. You have to change all related item templates.
And there are problems in the future…
…with the update wizard of the next visual studio release
…with future project and item templates...
I wouldn’t do it!
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