【问题标题】:Is there any way to find framework version of the project by means DTE or VSproject object?有没有办法通过 DTE 或 VSproject 对象找到项目的框架版本?
【发布时间】:2016-05-13 23:39:36
【问题描述】:

我有一个插件,用于根据项目的框架将 dll 添加到项目中。为此,我需要了解项目的 .NET 框架工作,我可以通过阅读 .csproj 文件来实现的项目。但我正在寻找的是通过 dte/vsproject 对象获取它的方法。有什么办法吗?

谢谢,

【问题讨论】:

标签: c# .net vs-extensibility


【解决方案1】:

您可以从 EnvDTE 获取它,使用:

Project.Properties.Item("TargetFramework").Value

见:

HOWTO: Get the target .NET Framework of a Visual Studio 2008 project from a Visual Studio add-in or macro

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-07-09
    • 2018-08-19
    • 1970-01-01
    • 1970-01-01
    • 2021-09-21
    • 2020-11-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多