VS2008 自动生成的文件与源代码管理只读签出:最佳实践?

发布于 2024-08-21 12:38:30 字数 865 浏览 4 评论 0原文

我们有一个使用 Visual Studio 2008 构建的代码库,其中包含资源文件 (SR.resx)。某些工具将从 SR.resx 创建一个名为“SR.Designer.cs”的文件,VS2008 将其添加到源代码管理中。第一次创建时一切都很好。当第二个开发人员检查他机器上的源代码时,事情就变得很糟糕。

我们使用 Perforce,它以只读方式签出文件。

如果第二个开发人员从头开始,则第一个构建通常会失败,并显示消息“无法写入强类型资源类文件“SR.Designer.cs”。我们需要将所有文件设置为读写才能执行此操作尽管 SR.Designer.cs 文件没有更改(在构建后通过“diff”进行检查),但这

也会对我们的构建服务器造成严重破坏,我们希望从 SR.Designer.cs 文件开始进行构建 。空目录,提取源代码并构建。

生成的代码包含:

/// <summary>
///   A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.

我可以以任何方式配置 StronglyTypedResourceBuilder 吗

We have a codebase built using Visual Studio 2008 that contains resource files (SR.resx). Some tool will create a file named "SR.Designer.cs" from SR.resx and VS2008 adds it to source control. All is well when first created. Things go badly when a second developer checks out the sources on his machine.

We use Perforce, which checks out files read-only.

If the second developer is starting from scratch, the first build generally fails with the message "Cannot write to the Strongly Typed Resource class file "SR.Designer.cs". We need to set all the files to read-write in order to do the build. This despite the fact that the SR.Designer.cs files are not changed (checked via "diff" after the build).

This also plays havoc with our build server, where we'd like to do the build starting from an empty directory, pull the sources and build.

How do folks deal with this situation?

The generated code contains:

/// <summary>
///   A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.

Can I configure StronglyTypedResourceBuilder in any way?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

感悟人生的甜 2024-08-28 12:38:30

将相关文件的文件属性更改为 +w(在工作区中始终可写)。在命令行上,您可以使用以下命令执行此操作。

p4 reopen -t +w <file>

您也可以在 P4V 中使用 Actions -> 执行此操作更改文件类型。

Change the file attributes of the files in question to +w (always writable in workspace). On the command line, you can do this with

p4 reopen -t +w <file>

You can also do this in P4V with Actions -> Change Filetype.

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