设置 StyleCop 进行团队发展
我们正在尝试为团队开发环境设置 stylecop。到目前为止,我们所做的是:
- 将文件签入源代码管理 在
- 指向该位置的每台计算机上创建一个环境变量(每个开发人员都将源代码签出到不同的位置,这解决了这个问题)
- 将标签添加到项目中,如下所示:
这很好用,但是 VS 抱怨该文件不安全,我知道要解决这个问题,我们必须在注册表中标记为安全。我们希望创建一个 .reg 文件来导入此设置并使每个人都更容易。我们可以在路径中使用该环境变量吗?我已经尝试过下面的代码片段,但这似乎不起作用。环境变量的语法是否不同?
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\MSBuild\SafeImports]
"StyleCop.4.3"="%StyleCopLocation%\\Microsoft.StyleCop.Targets"
We are trying to setup stylecop for a team development environment. So far what we have done is:
- Checked the files into source control
- Create an environment variable on every machine that points to that location (each dev has source checked out to a different location, this solves that)
- Add the tag to the project as follows:
This works great, but VS complains that the file is unsafe, and I know to fix that we have to mark is safe in the registry. We wanted to create a .reg file to import this setting and make it easier for everyone. Can we use that environment variable in the path? I have tried the snippet below, but that doesn't seem to work. Is the syntax for an environment variable different?
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\MSBuild\SafeImports]
"StyleCop.4.3"="%StyleCopLocation%\\Microsoft.StyleCop.Targets"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为什么需要在全球范围内托管该 Targets 文件?每个人都可以安装 StyleCop 的副本。
如果您确实计划共享 StyleCop 设置,请将项目配置为使用项目本地设置文件 (*.SourceAnalysis)。您可以将此文件与您的项目一起检入,然后每个人都保持同步。
Why you need to host that Targets file in a global place? Everyone can install a copy of StyleCop.
If you in fact plan to share StyleCop settings, please configure the projects to use a project locally setting file (*.SourceAnalysis). You can check in this file along with your projects, and then everyone is in sync.