Search code examples
c#asp.netvisual-studio-2008file-rename

I can't rename filename in VS


I have a file called Default2.aspx that I'm trying rename to Default.aspx, but when I try to do it, the visual studio just rename back to Default2.aspx name. Don't give even any error message. I don't know how to fix this. There's other file called Default.aspx anymore. I've already tried also restarting VS and even the pc. No luck.

I think that it is because VS believe still that there's the older Default.aspx file.. even if so, I still don't know where exactly look at to check out this. also, couldn't VS give an error message? and is not this a VS bug?

I'm using VS 08 with ASP.NET appplication editing C# code


Solution

  • Are you right clicking on the file and selecting rename? Usually if this does not work for some reason it will give an error.

    You can edit the file outside of the VS environment (this can be done easily by right clicking on the file, selecting "show containing folder" and changing the name there). When you go back to VS, it should give you a message mentioning that the file name was changed outside the application and asking you to reload with changes. However, depending on the type of file, this may break auto-generated statements that were based on the file's original name.