Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0389d84

Browse files
jasonmalinowskiKevinRansom
authored andcommitted
Fix build events buttons even more correctly (#3399)
* Correctly fetch the IVsBuildMacroInfo to use for the build events pageThis code is blindly copied and pasted fromhttps://github.com/dotnet/project-system/blob/88606ba869a29aa24979e0d14a199b2430f31f43/src/Microsoft.VisualStudio.Editors/PropPages/BuildEventsPropPage.vb#L162-L176I will fully admit I have no idea how this is supposed to work.* Even more correctly fetch the IVsBuildMacroInfo to use for the build events pageMy previous change broke projects with the old project system. Trythe old path and if that doesn't work, then try the new path.
1 parentaa88d31 commit0389d84

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

‎vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/BuildEventsPropPage.vb‎

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,22 @@ Namespace Microsoft.VisualStudio.Editors.PropertyPages
336336
DimMacroEvalAsIVsBuildMacroInfo
337337
DimMacroValueAsString=Nothing
338338

339-
MacroEval=CType(m_Objects(0),IVsBuildMacroInfo)
339+
' The old project system provides IVsBuildMacroInfo this way...
340+
MacroEval=TryCast(m_Objects(0),IVsBuildMacroInfo)
341+
IfMacroEvalIsNothingThen
342+
DimHierAsIVsHierarchy=Nothing
343+
DimItemIdAsUInteger
344+
DimThisObjAsObject=m_Objects(0)
345+
346+
' ...whereas CPS requires us to go through IVsBrowseObject.
347+
IfTypeOfThisObjIsIVsBrowseObjectThen
348+
VSErrorHandler.ThrowOnFailure(CType(ThisObj,IVsBrowseObject).GetProjectItem(Hier,ItemId))
349+
ElseIfTypeOfThisObjIsIVsCfgBrowseObjectThen
350+
VSErrorHandler.ThrowOnFailure(CType(ThisObj,IVsCfgBrowseObject).GetProjectItem(Hier,ItemId))
351+
EndIf
352+
MacroEval=CType(Hier,IVsBuildMacroInfo)
353+
EndIf
354+
340355
VSErrorHandler.ThrowOnFailure(MacroEval.GetBuildMacroValue(MacroName,MacroValue))
341356

342357
ReturnMacroValue

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp