How to determinate Target Platform of project via EnvDTE.Project interface
I am trying to determinate the target platform of Visual Studio project via automation model. However i still do not succeed in this. Does anybody know how to obta开发者_Go百科in project's target platform with DTE (Any CPU/x86/x64)?
Here is a Visual Studio macro that will print out the target platform of the active project to the macro output window when run with F5 from the macro IDE:
Public Sub ShowProjectPlatform()
Dim project As Project = CType(CType(DTE.ActiveSolutionProjects, Object())(0), Project)
System.Diagnostics.Debug.WriteLine("TargetPlatform = " & project.ConfigurationManager.ActiveConfiguration.Properties.Item("PlatformTarget").Value)
End Sub
精彩评论