晦涩的错误:无法重构文件'' [英] Obscure Error: The File '' Could Not Be Refactored

查看:77
本文介绍了晦涩的错误:无法重构文件''的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有时候,我遇到一个属性,当我尝试使用内置的Visual Studio重构选项对其重命名时,会出现一个对话框,提示:

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   ]


引用文件时,该对话框实际上显示了空的撇号. Google不提供任何帮助.我开始认为这是一个晦涩的Visual Studio错误,应该将其报告给Microsoft Connect.以为我会先看看你们中是否有人遇到过它.

仅供参考,我的解决方案/项目运行良好.在任何XAML中均未引用该属性.我尝试删除".suo"文件,"bin"目录和"obj"文件夹,然后重建,但仍然没有骰子.我有最新的Microsoft更新. Visual C#2008 Express和Visual Studio 2008 Professional都会出现此问题.尽管没关系,该属性如下所示:


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
{
    get;
    set;
}


我重命名同一文件中同一类中的其他属性没有问题,例如:


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

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.

推荐答案

回答我自己的问题...

我将其发布在 Microsoft Connect 上.微软承认该错误,并表示将不修复它.他们没有说为什么不解决这个问题. :(

微软表示已解决该问题.
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. :(

Microsoft said they fixed the problem.


这篇关于晦涩的错误:无法重构文件''的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆