Visual Studio颜色未正确加载

时间:2022-08-24 21:51:25

I use a custom color scheme in Visual Studio (black background, gray text, etc.). There a few settings that refuse to change, however. For example, when cursoring through the markup for an aspx page, the current tag defaults to black text, which doesn't work well on my black background. I've previously changed the appropriate setting to a "visible" color. In fact, to fix it, all I have to do is open the Options window, check and uncheck the Bold setting on Plain Text and hit OK, and now all my chosen settings are properly loaded. If I open a new session though, I have to go through these steps again. There are only a few settings where I notice this behavior (the Read-Only Region is another one), but it's annoying to have to do a dummy option change to get them to kick in. Has anyone seen this behavior before, and does anyone have a fix/workaround?

我在Visual Studio中使用自定义颜色方案(黑色背景,灰色文本等)。但是,有一些设置拒绝改变。例如,当通过标记浏览aspx页面时,当前标记默认为黑色文本,这在我的黑色背景上不能很好地工作。我之前已将适当的设置更改为“可见”颜色。实际上,为了解决这个问题,我所要做的就是打开选项窗口,选中并取消选中纯文本上的粗体设置,然后单击确定,现在我所有选择的设置都已正确加载。如果我打开一个新会话,我必须再次执行这些步骤。只有少数几个设置我注意到这种行为(只读区域是另一个),但是必须做一个虚拟选项更改以让它们启动是很烦人的。有没有人见过这种行为,任何人都有有修复/解决方法?

UPDATE: Found an interesting fix. I still don't know what the root cause is (probably some corruption as @sliderhouserules suggessts), but I've got a quicker way to fix it than using Tools | Options | Fonts and Colors. I simply exported my current color settings and created a macro to load them in:

更新:找到一个有趣的解决方案。我仍然不知道根本原因是什么(可能是@sliderhouserules建议的一些腐败),但我有一个更快的方法来解决它比使用工具|选项|字体和颜色。我只是导出了我当前的颜色设置并创建了一个宏来加载它们:

Public Sub ImportColors()
    DTE.ExecuteCommand("Tools.ImportandExportSettings", "-import:""C:\Documents and Settings\gregf\My Documents\Visual Studio 2008\Settings\FontsAnColors_Exported-2008-12-05.vssettings""")
End Sub

I then mapped that macro to a button on my toolbar. Now I have a one-click fix whenever my colors go awry. Not ideal, but much less painful now.

然后我将该宏映射到工具栏上的按钮。现在,只要我的颜色出错,我就可以一键修复。不理想,但现在痛苦少得多。

1 个解决方案

#1


1  

Sounds to me like you may have some corruption in your VS install or something (IE you need to reinstall VS). This doesn't sound like a bug, and you'd be fishing in the dark trying to repair your registry or whatever config files are involved in setting and storing these options for VS.

听起来像你可能在你的VS安装或某些东西(IE你需要重新安装VS)有一些腐败。这听起来不像是一个bug,你会在黑暗中钓鱼试图修复你的注册表或任何配置文件涉及为VS设置和存储这些选项。

#1


1  

Sounds to me like you may have some corruption in your VS install or something (IE you need to reinstall VS). This doesn't sound like a bug, and you'd be fishing in the dark trying to repair your registry or whatever config files are involved in setting and storing these options for VS.

听起来像你可能在你的VS安装或某些东西(IE你需要重新安装VS)有一些腐败。这听起来不像是一个bug,你会在黑暗中钓鱼试图修复你的注册表或任何配置文件涉及为VS设置和存储这些选项。