/obj/debug 破坏构建中的 TemporaryGeneratedFile_[guid] [英] TemporaryGeneratedFile_[guid] in /obj/debug breaking build

查看:32
本文介绍了/obj/debug 破坏构建中的 TemporaryGeneratedFile_[guid]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 obj/debug 中创建了 3 个临时文件:

I have 3 temporary files being created in obj/debug:

例如

  • TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
  • TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
  • TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs

(即使在解决方案清理后,guids 似乎也没有改变)

(The guids don't seem to change even after a solution clean)

我的构建失败,因为:

SA1633:文件没有标题,标题 Xml 无效,或标题不在文件顶部.

SA1633: The file has no header, the header Xml is invalid, or the header is not located at the top of the file.

我不想关闭 StyleCop 规则.如何找出创建这些临时文件的原因?

I don't want to turn the StyleCop rule off. How do I find out what is creating these temporary files?

该站点是一个 asp.net MVC 4 站点,有 5 个模型、4 个控制器、2 个类、2 个 aspx 网页和 1 个服务引用,在数字上似乎与 3 个文件不符.

The site is an asp.net MVC 4 site, with 5 models, 4 controllers, 2 classes, 2 aspx web pages and 1 service reference, which numerically don't seem to tally with the 3 files.

有什么指点吗?

如果我将框架从 4.5 改回 4,这些文件就会消失并且构建成功.

If I change framework from 4.5 back to 4 these files go away and the build is successful.

我的 StyleCop 版本是 4.4,我非常愿意找到一种方法让它忽略 obj/debug

My version of StyleCop is 4.4, I'm more than open to finding a way to get it to ignore obj/debug

推荐答案

在 StyleCop.Settings 文件的解析器块中,为这些文件添加一个条目:该值是一个正则表达式,因此可以使用更紧密的匹配 guid 的值,但这些满足我现在的需要.

In the parsers block of a StyleCop.Settings file add an entry for these files: The value is a regex, so a tighter one for matching a guid could be used, but these meets my need for now.

  <Parsers>
    <Parser ParserId="Microsoft.StyleCop.CSharp.CsParser">
      <ParserSettings>
        <BooleanProperty Name="AnalyzeDesignerFiles">False</BooleanProperty>
        <CollectionProperty Name="GeneratedFileFilters">
          <Value>.g.cs$</Value>
          <Value>.generated.cs$</Value>
          <Value>.g.i.cs$</Value>
          <Value>TemporaryGeneratedFile_.*.cs$</Value>
        </CollectionProperty>
      </ParserSettings>
    </Parser>
  </Parsers>

这篇关于/obj/debug 破坏构建中的 TemporaryGeneratedFile_[guid]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆