File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
DotNETBuild/Utils/DotNetBuildTools_ Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 11using System ;
22using System . IO ;
3+ using System . Linq ;
34using System . Reflection ;
45using dotnetCampus . Configurations ;
56using dotnetCampus . DotNETBuild . Context ;
@@ -131,19 +132,24 @@ private bool CheckCodeDirectory(string directory)
131132
132133 private FileInfo FindSlnOrCsprojFile ( DirectoryInfo directory )
133134 {
134- // 优先找 sln 文件
135+ // 优先找 sln/slnx 文件
135136 // 如果找不到,找 csproj 文件
136137 // 如果找不到,返回空
137138 // 如果找到大于一个文件,异常
138139
139140 var slnFileList = Directory . GetFiles ( directory . FullName , "*.sln" ) ;
141+ var slnxFileList = Directory . GetFiles ( directory . FullName , "*.slnx" ) ;
142+
143+ slnFileList = slnFileList . Concat ( slnxFileList ) . ToArray ( ) ;
144+
140145 if ( slnFileList . Length > 1 )
141146 {
142147 throw new ArgumentException (
143- $ "在{ directory } 找到大于一个 sln 文件,找到的文件如下:{ string . Join ( ';' , slnFileList ) } ") ;
148+ $ "在{ directory } 找到大于一个 sln/slnx 文件,找到的文件如下:{ string . Join ( ';' , slnFileList ) } ") ;
144149 }
145150 else if ( slnFileList . Length == 1 )
146151 {
152+ // 正确找到了
147153 return new FileInfo ( slnFileList [ 0 ] ) ;
148154 }
149155 else
You can’t perform that action at this time.
0 commit comments