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

Set modified date in EmbeddedFileProvider #210

Merged
merged 1 commit into from
Jul 5, 2016
Merged

Conversation

BrennanConroy
Copy link
Member

#208

Apps that target >=net462 or netcoreapp1.0 will get the new behavior
Other targets will get the DateTimeOffset.Now behavior

@Eilon @Tratcher @pakrym

// REVIEW: Does this even make sense?
_lastModified = DateTimeOffset.MaxValue;

_lastModified = DateTimeOffset.Now;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UtcNow?

@BrennanConroy
Copy link
Member Author

🆙 📅

#if NETSTANDARD1_5
if (_assembly.Location != null)
{
_lastModified = File.GetLastWriteTimeUtc(_assembly.Location);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can throw a lot of exceptions that we may be better off suppressing.
https://msdn.microsoft.com/en-us/library/system.io.file.getlastwritetimeutc(v=vs.110).aspx

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, thoughts @Eilon @pranavkm

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

The location of the loaded file that contains the manifest. If the loaded file was shadow-copied, the location is that of the file after being shadow-copied. If the assembly is loaded from a byte array, such as when using the Load(Byte[]) method overload, the value returned is an empty string ("").

Lots of edge cases.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No harm in try catching this? On a bit of a tangent, did we consider having the alternative where the user specifies this value? It removes a bunch of this guessing from our code (plus the oddity with having different behavior based on what you might be targeting)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not a bad cop-out..

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We considered it, but weren't huge fans

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

casual fans?

@Tratcher
Copy link
Member

:shipit:

1 similar comment
@pranavkm
Copy link
Contributor

pranavkm commented Jul 1, 2016

:shipit:

@BrennanConroy
Copy link
Member Author

🆙 📅

@BrennanConroy
Copy link
Member Author

Ping @Tratcher @pranavkm

@pranavkm
Copy link
Contributor

pranavkm commented Jul 5, 2016

:shipit:

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants