其中C#版本我使用 [英] which version of C# am I using

查看:168
本文介绍了其中C#版本我使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是那么容易,因为它似乎:我想了解我使用的C#的版本。
。如果我将使用python,我会做的命令行类似蟒蛇-V ,或按

My question is as easy as it seems: I want to find out which version of C# I am using. If I would be using python I would do something like python -V from command line, or type

import sys
print sys.version

在PHP中我会做这样的事:的phpinfo(); 在java中: Java的版本

In php I would do something like this: phpinfo(); in java: java -version

但我无法找到如何在C#中实现这一点。

But I was not able to find how to achieve this in C#.

我完全新的C#,所以请不要打我太辛苦了。最让我惊讶,我是不是能够找到SO这个答案,因此,我觉得我很想念在寻找的东西的东西还是坏。 BTW,这个问题没有接听,但顾名思义,它应该的。

I am completely new to C#, so please do not beat me too hard. What surprises me that I was not able to find this answer on SO, therefore I think that I am missing something or bad in finding things. BTW, this question does not answer it, although the name suggests that it should.

感谢您的答案。现在我得到了它依赖于.NET框架,但有没有搞清楚我的框架的编程方式? (不用去的目录,并检查我的.NET的文件夹的名称)

Thank you for answers. Right now I got that it depends on .NET framework, but is there a programmatic way of figuring out my framework? (without going to the directory and checking the name of my .NET folders)

推荐答案

要获得framework版本 - 看版主要部件之一,即

To get version of framework - look at version of one of main Assemblies i.e.

 Console.Write(typeof(string).Assembly.ImageRuntimeVersion);



入门C#编译器的版本是有点困难,但你应该能够猜到版本通过检查什么框架。版本用于

Getting version of C# compiler is somewhat harder, but you should be able to guess version by checking what framework version is used.

如果您正在使用命令行编​​译器(csc.exe),您可以查看帮助,看的版本(也是你需要知道Framework版本反正:

If you are using command line compiler (csc.exe) you can check help to see version (also you'd need to know Framework version anyway:

C:\Windows\Microsoft.NET\Framework\v4.0.30319>csc /?
Microsoft (R) Visual C# 2010 Compiler version 4.0.30319.1

这篇关于其中C#版本我使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆