将 C# 类模板恢复为默认模板
我刚刚安装了 StyleCop 4.5,默认模板已被替换为一些我现在不太喜欢的模板。我怎样才能将其恢复为默认值?
I have just installed StyleCop 4.5 and default templates have been replaced with some I don't really appreciate right now. How can I revert it to default?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我解决了这个问题。
可以恢复这些更改,因为 Visual 具有旧类模板的备份。
所有模板都放置在这样的文件夹中:
C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\CSharp\Code\1033
恢复后还有一件事要做,打开cmd并输入命令:
devenv /setup
这将更新更改。
I solved that.
There's possibility to revert that changes, because visual has backups for old classes templates.
All templates are placed in folder like this:
C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\CSharp\Code\1033
After reverting there is one more thing to do, open cmd and enter command:
devenv /setup
This will update changes.
不确定您使用的是哪个确切版本,但在最新版本(4.6.3.0 应该相当于最新的 4.5,但与 R# 6.0 兼容)上,如果您重新运行 StyleCop 安装程序,您可以更改安装,包括卸载 VS 模板同时保持安装的其余部分完好无损。
Not sure which exact version you are using, but on the latest version (4.6.3.0 which should be equivalent to the latest 4.5 but with R# 6.0 compat) if you rerun the StyleCop installer, you can change the installation including uninstalling the VS templates while leaving the rest of the installation intact.
我也遇到了同样的问题,但我花了一点时间才发现是 stylecop 导致我的模板发生了变化。(安装新的 stylecop 版本后我有一段时间没有编码)
无论如何,为了解决这个问题,我安装了最新版本的style cop然后卸载。他们修复了更高版本的安装程序,以确保它将您的 Visual Studio 模板恢复为默认模板。
最后,我再次安装了最新版本,并在安装过程中确保排除更新 Visual Studio 模板。
我希望这对其他人有帮助。
I had this same problem, but took me a bit to figure out that it was stylecop that had caused my templates to change.(I had not coded in a while after installing the new stylecop version)
Anyways, to fix this issue, I installed the latest version of style cop and then un-installed. They have fixed the later version installer to ensure it reverts your visual studio templates back to the vs default templates.
Finally, I installed the latest version again and during the install I made sure to Exclude updating the visual studio templates.
I hope this helps someone else.