Is there a .NET Core CLI pre before build task?

前端 未结 1 981
猫巷女王i
猫巷女王i 2020-12-14 03:30

The question

I assume when msbuild is about to compile source code files, it produces a list of files to build, based on Include and

1条回答
  •  一整个雨季
    2020-12-14 04:02

    The "default items" as the .NET SDK calls it are part of the static evaluation of the project file - before any target is run. So you'll need a target that is run before the @(Compile) items are needed.

    The trick is to include files added to the filesystem after the custom tool is run. This can be done by re-scanning all files and excluding those already part of the project inside a target that is run before the build:

      
        
        
          
        
      
    

    0 讨论(0)
提交回复
热议问题