Skip to content

Commit 6a5c039

Browse files
committed
Avoid FxCop errors about localizing serialized data
- aspnet#17
1 parent ddf0764 commit 6a5c039

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/System.Web.Http.WebHost/HttpControllerTypeCacheSerializer.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
using System.Collections.Generic;
55
using System.Diagnostics.CodeAnalysis;
6+
using System.Globalization;
67
using System.IO;
78
using System.Linq;
89
using System.Reflection;
@@ -100,7 +101,7 @@ into groupedByModule
100101

101102
XmlElement typeCacheElement = doc.CreateElement("typeCache");
102103
doc.AppendChild(typeCacheElement);
103-
typeCacheElement.SetAttribute("lastModified", CurrentDate.ToString());
104+
typeCacheElement.SetAttribute("lastModified", CurrentDate.ToString(CultureInfo.InvariantCulture));
104105
typeCacheElement.SetAttribute("mvcVersionId", _mvcVersionId.ToString());
105106

106107
foreach (var assemblyGroup in groupedByAssembly)

src/System.Web.Mvc/TypeCacheSerializer.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
using System.Collections.Generic;
55
using System.Diagnostics.CodeAnalysis;
6+
using System.Globalization;
67
using System.IO;
78
using System.Linq;
89
using System.Reflection;
@@ -95,7 +96,7 @@ into groupedByModule
9596

9697
XmlElement typeCacheElement = doc.CreateElement("typeCache");
9798
doc.AppendChild(typeCacheElement);
98-
typeCacheElement.SetAttribute("lastModified", CurrentDate.ToString());
99+
typeCacheElement.SetAttribute("lastModified", CurrentDate.ToString(CultureInfo.InvariantCulture));
99100
typeCacheElement.SetAttribute("mvcVersionId", _mvcVersionId.ToString());
100101

101102
foreach (var assemblyGroup in groupedByAssembly)

0 commit comments

Comments
 (0)