A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
Hi @liu juan ,
I successfully output the .NET version number in the main function. I created a CLR project and my C++/CLI version is 4.8. You could refer to my method.
#include "pch.h"
using namespace ClassLibrary1;
using namespace System;
#include<iostream>
int main(array<System::String ^> ^args)
{
Class1 c1;
int a = c1.myprint();
String ^ b = AppDomain::CurrentDomain->SetupInformation->TargetFrameworkName;
Console::WriteLine(b);
std::cout << "1";
system("pause");
//auto a = AppDomain.CurrentDomain.SetupInformation.TargetFrameworkName;
// System.Console.WriteLine(a);
return 0;
}
Best regards,
Elya
If the answer is the right solution, please click "Accept Answer" and upvote it.If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.