Skip to content
This repository has been archived by the owner on Nov 6, 2018. It is now read-only.

Commit

Permalink
Set modified date in EmbeddedFileProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
BrennanConroy committed Jul 5, 2016
1 parent 4ce656c commit a5366af
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,24 @@ public EmbeddedFileProvider(Assembly assembly, string baseNamespace)

_baseNamespace = string.IsNullOrEmpty(baseNamespace) ? string.Empty : baseNamespace + ".";
_assembly = assembly;
// REVIEW: Does this even make sense?
_lastModified = DateTimeOffset.MaxValue;

_lastModified = DateTimeOffset.UtcNow;

#if NETSTANDARD1_5 || NET451
if (!string.IsNullOrEmpty(_assembly.Location))
{
try
{
_lastModified = File.GetLastWriteTimeUtc(_assembly.Location);
}
catch (PathTooLongException)
{
}
catch (UnauthorizedAccessException)
{
}
}
#endif
}

/// <summary>
Expand Down
13 changes: 9 additions & 4 deletions src/Microsoft.Extensions.FileProviders.Embedded/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,18 @@
"version": "1.1.0-*",
"type": "build"
},
"Microsoft.Extensions.FileProviders.Abstractions": "1.1.0-*"
"Microsoft.Extensions.FileProviders.Abstractions": "1.1.0-*",
"System.Runtime.Extensions": "4.1.0-*"
},
"frameworks": {
"netstandard1.0": {
// need to keep netstandard1.0 until ASP.NET Core 2.0 because it is a breaking change if we remove it
"netstandard1.0": { },
"netstandard1.5": {
"dependencies": {
"System.Runtime.Extensions": "4.1.0-*"
"System.IO.FileSystem": "4.0.1-*",
"System.Reflection": "4.1.0-*"
}
}
},
"net451": { }
}
}

0 comments on commit a5366af

Please sign in to comment.