TemporaryGeneratedFile_[guid] in /obj/debug breaking build

后端 未结 6 1857
我在风中等你
我在风中等你 2020-12-24 04:58

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

E.g.

  • TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
  • TemporaryGeneratedFil
6条回答
  •  滥情空心
    2020-12-24 05:25

    The 3 files with "TemporaryGeneratedFile_" prefix are auto-generated by the Microsoft.WorkflowBuildExtensions.targets file most likely imported via the chain:

    • *.csproj -->
    • Microsoft.CSharp.targets -->
    • Microsoft.Common.targets -->
    • Microsoft.WorkflowBuildExtensions.targets

    They are generated under the intermediate output path pointed by the $(IntermediateOutputPath) MSBuild property, usually something like obj\debug. One way to deal with the StyleCop warnings/errors about these auto-generated files is to tell StyleCop to skip any *.cs files under the $(IntermediateOutputPath). For example, include the following item in your project:

    
        
    
    

    ExcludeFromStyleCop is an item name recognized by the StyleCop.targets file to exclude files from analysis during a build (at least for StyleCop 4.7). The double star ** is MSBuild syntax for searching recursively under a folder.

    The new item might show up in the Solution Explorer in Visual Studio. If that is undesirable it can be hidden by using the 'Visible' item metadata:

    
        
            False
        
    
    

    Similar approach can be used to exclude other files if necessary. I hope that helps.

提交回复
热议问题