Click here to Skip to main content
15,881,803 members
Please Sign up or sign in to vote.
5.00/5 (2 votes)
See more:
Sometimes, I come across a property that, when I try to rename it using the built-in Visual Studio refactoring option, I get a dialog that says:
The file '' could not be refactored. Object reference not set
to an instance of an object.

Do you wish to continue with the refactoring?

[ ] Ignore further refactoring errors
                             [   Yes   ] [   No   ]

The dialog actually shows empty apostrophes when referring to the file. Google doesn't provide any help. I'm beginning to think this is an obscure Visual Studio bug and that I should report it to Microsoft Connect. Thought I'd see if any of you have come across it before first.

FYI, my solution/projects build fine. The property is not referenced in any XAML. I tried deleting my ".suo" file, my "bin" directory, and my "obj" folder, then rebuilding, but still no dice. I have the latest Microsoft updates. The problem occurs with both Visual C# 2008 Express and Visual Studio 2008 Professional. Though it should not matter, the property looks like this:
C#
private MigrationRequestViewModel Request
{
    get;
    set;
}

I have no problem renaming other properties in the same class in the same file, such as this one:
C#
private MigrationRequestViewModel RequestSnapshot
{
    get;
    set;
}

Any ideas? Note that I realize I could just find all reference to the property and manually rename it, but I'd like to get to the bottom of this error dialog.
Posted
Updated 4-Apr-10 17:18pm
v4

1 solution

To answer my own question...

I posted this on Microsoft Connect. Microsoft acknowledged the bug and said they will not be fixing it. They did not say why they will not be fixing it. :(

EDIT: Microsoft said they fixed the problem.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900