How to find a .NET application?

I am working on a scanning view of an application that uses different C # codebases as input. I want to know in which .NET Framework version (1.1 / 2.0 / 3.5 / 4.0) a specific code base is built.

Can someone provide me with code to check the version of the .NET code of the codebases? can i read the code version from the .csproj file? If yes, provide the code for this.

Thank,

Teena.

+3
source share
5 answers

Look for attributes TargetFrameworkVersionand RequiredTargetFrameworkin the .csproj file: there is to discover and analyze the project file.

+4
source

Can someone provide me with code to check the version of the .NET code of the codebases? can i read the code version from the .csproj file?

Project :

string projectFileName = ...
Project proj = new Project(projectFileName);
string version = proj.GetPropertyValue("TargetFrameworkVersion");
+1

cs proj XML-

, , XML-.

0
var document = XDocument.Load("ProjectName.csproj");
var targetFramework = document
    .Descendants(XName.Get("TargetFrameworkVersion", "http://schemas.microsoft.com/developer/msbuild/2003"))
    .First()
    .Value;
0

Windows:

1) , .

2) "" "ALT + ENTER".

3) "" .

4) " .." .

5) A pop-up window "Parameters" will appear, from which you can learn "Target structure". From this you can also change the structure of your application and save the settings. Here it is.

You can also refer to the following image for a quick overview:

enter image description here

enter image description here

0
source

All Articles