我的C#解决方案需要更长的编译时间。
有没有一种方法可以描述构建过程,以了解花费了这么长时间?
最佳答案
MSBuild中已经内置了一个探查器。工具+选项,项目和解决方案,生成和运行,“ MSBuild项目生成输出详细信息”。将其更改为诊断。
什么都不做的项目的示例输出:
Project Performance Summary:
400 ms C:\Users\hpassant\AppData\Local\Temporary Projects\WindowsFormsApplication3\WindowsFormsApplication3.csproj 1 calls
400 ms Rebuild 1 calls
Target Performance Summary:
0 ms CreateSatelliteAssemblies 1 calls
0 ms ResolveReferences 1 calls
0 ms _CheckForInvalidConfigurationAndPlatform 1 calls
0 ms _SetTargetFrameworkMonikerAttribute 1 calls
0 ms ResGen 1 calls
0 ms BeforeResGen 1 calls
0 ms GetReferenceAssemblyPaths 1 calls
0 ms AfterCompile 1 calls
0 ms PrepareResources 1 calls
0 ms AfterCompileWinFX 1 calls
0 ms AfterResGen 1 calls
0 ms _ComputeNonExistentFileProperty 1 calls
0 ms BeforeClean 1 calls
0 ms Build 1 calls
0 ms GetTargetPath 1 calls
0 ms GetFrameworkPaths 1 calls
0 ms CompileRdlFiles 1 calls
0 ms AfterMarkupCompilePass1 1 calls
0 ms AfterResolveReferences 1 calls
0 ms BeforeBuild 1 calls
0 ms _CopySourceItemsToOutputDirectory 1 calls
0 ms _AfterCompileWinFXInternal 1 calls
0 ms CleanPublishFolder 1 calls
0 ms Clean 1 calls
0 ms CreateCustomManifestResourceNames 1 calls
0 ms PrepareResourceNames 1 calls
0 ms AfterRebuild 1 calls
0 ms PrepareRdlFiles 1 calls
0 ms CleanReferencedProjects 1 calls
0 ms ComputeIntermediateSatelliteAssemblies 1 calls
0 ms AfterClean 1 calls
0 ms BuildOnlySettings 1 calls
0 ms BeforeCompile 1 calls
0 ms SetWin32ManifestProperties 1 calls
0 ms FileClassification 1 calls
0 ms BeforeResolveReferences 1 calls
0 ms PrepareForRun 1 calls
0 ms DesignTimeMarkupCompilation 1 calls
0 ms CoreBuild 1 calls
0 ms Rebuild 1 calls
0 ms Compile 1 calls
0 ms GenerateTargetFrameworkMonikerAttribute 1 calls
0 ms AfterBuild 1 calls
0 ms _SplitProjectReferencesByFileExistence 1 calls
1 ms SplitResourcesByCulture 1 calls
1 ms GetCopyToOutputDirectoryItems 1 calls
1 ms _CheckForCompileOutputs 1 calls
1 ms _GenerateCompileInputs 1 calls
1 ms DesignTimeXamlMarkupCompilation 1 calls
1 ms PrepareForBuild 1 calls
1 ms _GenerateSatelliteAssemblyInputs 1 calls
1 ms CreateManifestResourceNames 1 calls
1 ms _SetEmbeddedWin32ManifestProperties 1 calls
1 ms BeforeRebuild 1 calls
1 ms ResolveProjectReferences 1 calls
1 ms IncrementalClean 1 calls
2 ms _CleanGetCurrentAndPriorFileWrites 1 calls
5 ms CopyFilesToOutputDirectory 1 calls
6 ms ResolveAssemblyReferences 1 calls
7 ms AssignTargetPaths 1 calls
13 ms CoreResGen 1 calls
54 ms CoreClean 1 calls
298 ms CoreCompile 1 calls
Task Performance Summary:
0 ms GetFrameworkPath 1 calls
0 ms ReadLinesFromFile 2 calls
0 ms ConvertToAbsolutePath 1 calls
0 ms RemoveDuplicates 3 calls
0 ms AssignCulture 1 calls
0 ms CreateCSharpManifestResourceName 1 calls
0 ms MakeDir 2 calls
1 ms FindAppConfigFile 1 calls
1 ms FindUnderPath 7 calls
1 ms Message 3 calls
2 ms WriteLinesToFile 2 calls
4 ms Copy 2 calls
5 ms ResolveAssemblyReference 1 calls
6 ms AssignTargetPath 5 calls
12 ms GenerateResource 1 calls
51 ms Delete 3 calls
298 ms Csc 1 calls
关于visual-studio - 如何描述构建过程?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/3678708/