将 C# 类模板恢复为默认模板

发布于 2024-11-29 10:56:06 字数 63 浏览 4 评论 0原文

我刚刚安装了 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

剩一世无双 2024-12-06 10:56:06

我解决了这个问题。
可以恢复这些更改,因为 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.

や莫失莫忘 2024-12-06 10:56:06

不确定您使用的是哪个确切版本,但在最新版本(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.

桃酥萝莉 2024-12-06 10:56:06

我也遇到了同样的问题,但我花了一点时间才发现是 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文