Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法在运行时获取 EF 的版本?类似的东西
Console.WriteLine(Environment.Version);
将返回
4.0.30319.18034
扩展阿列克谢的想法,你可以做到
string version = typeof(DbSet).Assembly.GetName().Version.ToString();
从您感兴趣的框架中打印任何类型的程序集“版本”:
Console.Write( typeof(String).Assembly.GetName().Version);