总会new Version(AssemblyFileVersionAttribute.Version)
成功吗?
这是我的代码。
Contract.Ensures(Contract.Result<Version>() != null);
var ass = Assembly.GetExecutingAssembly();
var attributes = ass.GetCustomAttributes(typeof(AssemblyFileVersionAttribute), false).Cast<AssemblyFileVersionAttribute>();
var versionAttribute = attributes.Single();
return new Version(versionAttribute.Version)