弄清楚了。Site A 在 Common 之前建造的原因是因为.sln
文件中的顺序。更改解决方案中的顺序后,我能够让 PreBuildEvent 首先在 Common 中运行。
前:
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Site A", "SiteA.csproj", "{6E7FAE47-74A6-4740-9AC5-9599E850E834}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common", "Common.csproj", "{C510B337-7459-4494-BBCB-B79FECD2AA66}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Site B", "SiteB.csproj", "{F3CAFCE9-A96D-4EE5-BE09-420E27344345}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Site C", "SiteC.csproj", "{A50C5DE2-4846-40F2-86B1-B103F413DE0F}"
EndProject
后:
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common", "Common.csproj", "{C510B337-7459-4494-BBCB-B79FECD2AA66}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Site A", "SiteA.csproj", "{6E7FAE47-74A6-4740-9AC5-9599E850E834}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Site B", "SiteB.csproj", "{F3CAFCE9-A96D-4EE5-BE09-420E27344345}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Site C", "SiteC.csproj", "{A50C5DE2-4846-40F2-86B1-B103F413DE0F}"
EndProject