{
Log.Warn(LogTag, "Failed to get whether package " + pkgId + " is accessible or not");
}
- Interop.Package.PackageInfoGetInstalledTime(handle, out package._installedTime);
- if (err != Interop.PackageManager.ErrorCode.None)
+ try
+ {
+ Interop.Package.PackageInfoGetInstalledTime(handle, out package._installedTime);
+ if (err != Interop.PackageManager.ErrorCode.None)
+ {
+ Log.Warn(LogTag, "Failed to get installed time of " + pkgId);
+ }
+ }
+ catch (TypeLoadException)
{
- Log.Warn(LogTag, "Failed to get installed time of " + pkgId);
+ // To support in API vesion 3.0
+ package._installedTime = 0;
}
package._certificates = PackageCertificate.GetPackageCertificates(handle);