OSDN Git Service

na-get-lib,チケット #26588 (ソフトウェアインストールの)異常終了後に AppliStation が起動不可になる問題の暫定対処
authorunknown <tom@.(none)>
Sat, 22 Oct 2011 03:52:36 +0000 (12:52 +0900)
committerunknown <tom@.(none)>
Sat, 22 Oct 2011 03:52:36 +0000 (12:52 +0900)
na-get-lib/NaGet.Packages/PackageListsManager.cs
na-get-lib/NaGet/Utils.cs

index 34bb015..babf85e 100644 (file)
@@ -127,7 +127,10 @@ namespace NaGet.Packages
                        PackageList<InstalledPackage> pkgList = new PackageList<InstalledPackage>();\r
                        if (Directory.Exists(NaGet.Env.ArchiveProgramFiles)) {\r
                                foreach (string path in NaGet.Utils.ExtendWildcardFile(NaGet.Env.ArchiveProgramFiles, Path.Combine("*", ".applistation.package.xml"))) {\r
-                                       pkgList.AddPackage(NaGet.Utils.GetDeserializedObject<InstalledPackage>(path));\r
+                                       try {\r
+                                               pkgList.AddPackage(NaGet.Utils.GetDeserializedObject<InstalledPackage>(path));\r
+                                       } catch (Exception) {\r
+                                       }\r
                                }\r
                                this.installedPkgList = pkgList;\r
                        }\r
index 3e511b6..96c72ab 100644 (file)
@@ -385,7 +385,9 @@ namespace NaGet
                {\r
                        object retVal = null;\r
                        using (FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read)) {\r
-                               retVal = sr.Deserialize(fs);\r
+                               using (System.Xml.XmlReader xreader = System.Xml.XmlReader.Create(fs)) {\r
+                                       retVal = sr.Deserialize(xreader);\r
+                               }\r
                        }\r
                        return retVal;\r
                }\r