TemporaryGeneratedFile_ [GUID]在/ OBJ /调试破构建 [英] TemporaryGeneratedFile_[guid] in /obj/debug breaking build
问题描述
我在OBJ /调试创建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
(该guid似乎甚至不解决干净后更改)
(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 /调试
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>
这篇关于TemporaryGeneratedFile_ [GUID]在/ OBJ /调试破构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!