File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -336,7 +336,22 @@ Namespace Microsoft.VisualStudio.Editors.PropertyPages
336
336
Dim MacroEval As IVsBuildMacroInfo
337
337
Dim MacroValue As String = Nothing
338
338
339
- MacroEval = CType (m_Objects( 0 ), IVsBuildMacroInfo)
339
+ ' The old project system provides IVsBuildMacroInfo this way...
340
+ MacroEval = TryCast (m_Objects( 0 ), IVsBuildMacroInfo)
341
+ If MacroEval Is Nothing Then
342
+ Dim Hier As IVsHierarchy = Nothing
343
+ Dim ItemId As UInteger
344
+ Dim ThisObj As Object = m_Objects( 0 )
345
+
346
+ ' ...whereas CPS requires us to go through IVsBrowseObject.
347
+ If TypeOf ThisObj Is IVsBrowseObject Then
348
+ VSErrorHandler.ThrowOnFailure( CType (ThisObj, IVsBrowseObject).GetProjectItem(Hier, ItemId))
349
+ ElseIf TypeOf ThisObj Is IVsCfgBrowseObject Then
350
+ VSErrorHandler.ThrowOnFailure( CType (ThisObj, IVsCfgBrowseObject).GetProjectItem(Hier, ItemId))
351
+ End If
352
+ MacroEval = CType (Hier, IVsBuildMacroInfo)
353
+ End If
354
+
340
355
VSErrorHandler.ThrowOnFailure(MacroEval.GetBuildMacroValue(MacroName, MacroValue))
341
356
342
357
Return MacroValue
You can’t perform that action at this time.
0 commit comments