I am working on scanner kind of application which takes different C# codebases as input.I want to know in which .net framework version(1.1/2.0/3.5/4.0) specific codebase is built.
Can anybody provide me code to check .net framework version of codebases? can i read codebase version from .csproj file ? If yes, please provide code for same.
Thanks,
Teena.
Look for the TargetFrameworkVersion
and RequiredTargetFramework
attributes in the .csproj file: there's code here to open and parse the project file.
Can anybody provide me code to check .net framework version of codebases? can i read codebase version from .csproj file ?
Use the Project class:
string projectFileName = ...
Project proj = new Project(projectFileName);
string version = proj.GetPropertyValue("TargetFrameworkVersion");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With