@@ -160,7 +160,10 @@ private string[] GetKeys(string fileName)
160
160
161
161
private string GetMofFilepath ( string filePath )
162
162
{
163
- var mofFilePath = Path . GetFileNameWithoutExtension ( filePath ) + ".schema.mof" ;
163
+ var mofFilePath = Path . Combine (
164
+ Path . GetDirectoryName ( filePath ) ,
165
+ Path . GetFileNameWithoutExtension ( filePath ) ) + ".schema.mof" ;
166
+
164
167
return File . Exists ( mofFilePath ) ? mofFilePath : null ;
165
168
}
166
169
@@ -172,7 +175,7 @@ private Tuple<string, Version> GetModuleInfo(string fileName)
172
175
return null ;
173
176
}
174
177
175
- var moduleName = moduleManifest . Name ;
178
+ var moduleName = Path . GetFileNameWithoutExtension ( moduleManifest . Name ) ;
176
179
Token [ ] tokens ;
177
180
ParseError [ ] parseErrors ;
178
181
var ast = Parser . ParseFile ( moduleManifest . FullName , out tokens , out parseErrors ) ;
@@ -199,8 +202,10 @@ private Tuple<string, Version> GetModuleInfo(string fileName)
199
202
return null ;
200
203
}
201
204
205
+ var valueAst = moduleVersionKvp . Item2 . Find ( a => a is StringConstantExpressionAst , false ) ;
206
+ var versionText = valueAst == null ? null : ( ( StringConstantExpressionAst ) valueAst ) . Value ;
202
207
Version version ;
203
- Version . TryParse ( moduleVersionKvp . Item2 . Extent . Text , out version ) ;
208
+ Version . TryParse ( versionText , out version ) ; // this handles null so no need to check versionText
204
209
return version == null ? null : Tuple . Create ( moduleName , version ) ;
205
210
}
206
211
0 commit comments