Click here to Skip to main content
13,041,923 members (77,431 online)
Rate this:
Please Sign up or sign in to vote.
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:
private MigrationRequestViewModel Request

I have no problem renaming other properties in the same class in the same file, such as this one:
private MigrationRequestViewModel RequestSnapshot

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 4-Apr-10 16:47pm
Updated 4-Apr-10 17:18pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 19 Sep 2011
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100