0

I have an add in which is used to add dll to the project based on the framework of the project.for this i need to know the .NET Frame work of the project and i can achieve this by reading the .csproj file of the project. But what I am looking is Ways to get it via dte/vsproject object. is there any way?

Thanks,

user3610920
  • 1,582
  • 2
  • 13
  • 24
  • Check this question: http://stackoverflow.com/questions/3231632/how-to-find-the-net-framework-version-of-a-visual-studio-project – Nazmul Feb 04 '16 at 11:32
  • 1
    https://msdn.microsoft.com/en-gb/library/envdte.project(v=vs.110).aspx - Look at the remarks, might help. I believe you can get the version from the properties. – David McLean Feb 04 '16 at 11:33
  • Thanks, I an access frame work from project property. – user3610920 Feb 05 '16 at 08:36

1 Answers1

3

You can get it from EnvDTE, using:

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

See:

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

Carlos Quintero
  • 4,300
  • 1
  • 11
  • 18