VS2010:自动生成的 XML 文档文件不更新

发布于 2024-11-06 23:04:35 字数 826 浏览 0 评论 0原文

我在vs2010中有一个C#项目,生成一个XML文档文件,我已将生成文件的输出路径设置为项目输出路径。

我的问题是,当文档文件的路径与项目输出路径相同并且文件名相同(文件扩展名除外)时,文件不会更新。

更新 XML 文件:

  • C:\MyProjectFolder\MyProject.dll
  • C:\MyProjectFolder\MyProject.xml (文档文件)

但是当我更改为另一个文件夹或更改文档文件名时,该文件会正确生成。

更新 XML 文件:

  • C:\MyProjectFolder\MyProject.dll
  • C:\AnotherFolder\MyProject.xml

还会更新 XML 文件

  • C:\MyProjectFolder\MyProject.dll
  • C:\MyProjectFolder\AnotherFileName.xml

或更正确的是;当路径和文件名与第一个示例中的相同时,将重新生成文件,但包含旧信息和旧修改时间戳。

它以前在 VS 2008 中有效,我不想更改文件名或路径,因为其他人依赖它。

对可能出现的问题有什么建议吗? 难道是复制的临时文件?也许可以清除 VS 2010 文件夹中的一些缓存?

附加信息:我注意到,如果删除原始 XML 文档文件,然后在项目属性中指定新名称,则会生成新的 XML 文档并且是正确且最新的,但旧的 XML 文件具有旧名称也被重新创建 - 仍处于以前的状态。这必须缓存在某个地方......

I have a C# project in vs2010 that generates a XML documentation file, where I have set the output path of the generated file to the project output path.

My problem is that the file does not update when the path to the document file is the same as project output path, and the file names are the same (except for the file extensions).

Does not update XML file:

  • C:\MyProjectFolder\MyProject.dll
  • C:\MyProjectFolder\MyProject.xml
    (documentation file)

But when I change either to another folder or change the documentation file name, the file is generated correctly.

Does update XML file:

  • C:\MyProjectFolder\MyProject.dll
  • C:\AnotherFolder\MyProject.xml

does also update XML file

  • C:\MyProjectFolder\MyProject.dll
  • C:\MyProjectFolder\AnotherFileName.xml

Or more correctly; when the path and file name is the same as in the first example, the file is regenerated, but with old info and old modified time stamp.

It worked before in VS 2008, and I don't want to change the file name or path because others depend on it.

Any suggestions on what might be wrong?
Could it be a temporary file that is copied? Maybe some cache could be cleared in VS 2010 folder?

ADDITIONAL INFORMATION: I have noticed that if the original XML Documentation file is deleted, and then a new name specified in the project properties, the new XML Documentation is generated and is correct and up to date, but the old XML file with the old name is recreated too - still in its previous state. This must be cached somewhere...

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

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

发布评论

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

评论(3

热风软妹 2024-11-13 23:04:35

我在 Visual Studio 2015 Update 3 中也遇到了这个问题。

我在 Visual Studio 的“工具”> 中启用了“诊断”MSBuild 项目构建输出详细程度。选项并发现它正在从另一个项目的输出目录复制 XML 文档文件的版本。

只有在我对所有解决方案的构建配置进行Clean,然后重新构建我的项目之后,XML 文档文件才会重新生成并反映我的代码中的最新 XML 注释。

I also experienced this issue in Visual Studio 2015 Update 3.

I enabled Diagnostic MSBuild project build output verbosity in Visual Studio's Tools > Options and discovered that it was copying a version of the XML documentation file from another project's output directory.

Only after I did a Clean on all the solution's build configurations and then re-built my project, did the XML documentation file get regenerated and reflect the latest XML comments in my code.

云裳 2024-11-13 23:04:35

我面临着这个确切的问题,但我一生都无法解决它。

结果发现,我保存项目中使用的 dll 的文件夹中有旧版本的 .xml 文件。因此,Visual Studio 只是复制该 xml 文件,而不是生成新文件。 (这是在 Visual Studio Communtiy 2017 上进行的)

因此,请检查与任何引用的 dll 相同的目录中是否有旧版本的 .xml 文件。

I faced this exact problem and I couldn't figure it out for the life of me.

It turned out that I had a old version of the .xml file in a folder where I saved dlls used in the project. So visual studio was just copying that xml file instead of generating a new one. (This was on Visual Studio Communtiy 2017)

So check if you have a old version of the .xml file in any of the same directories as any of your referenced dlls.

十二 2024-11-13 23:04:35

我使用 VS 2010,并且我的 XML 文档在每次构建时都会正确重新生成。

即使是简单的重建也会强制文件更新。如果修改类描述并重建,您还应该获得包含更新后的描述的 XML。

I use VS 2010 and my XML documentation is regenerated correctly on each build.

Even a simple rebuild will force the file to update. If you modify the class description and rebuild, you should also get XML with the updated description.

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