IsolatedStorageFile.GetLastWriteTime for .NET 3.5
Asked Answered
N

1

0

I am trying to see if I can port a .NET 4 project (specifically, Cassette) to 3.5.

I finished the entire main project but now I'm on the last error and I can't seem to figure out a workaround.

Cassette uses Isolated Storage to store asset files and in .NET 4 the related classes have been overhauled to be much more useful. In .NET 3.5, however, there are a lot of things missing.

I am stuck on getting the last write time of an isolated file. Is there a way to do this in 3.5 or is it a lost cause?

MSDN for .NET 4

Nacelle answered 7/2, 2012 at 17:13 Comment(5)
How did you get on with this?Zephyrus
@jacko, for Cassette they did not use LastFileWriteTime for isolated storage, it was only used on actual files. So in the end it simply throws a NotImplementedException.Nacelle
In addition, I originally created a index file that would record write times for any file, then it would look it up when you asked. However, as I said above, overkill for Cassette specifically.Nacelle
Example of above workaround (gotta love version control!): github.com/kamranayub/cassette/blob/…Nacelle
I meant, with the cassette 3.5 fork :)Zephyrus
I
1

Perhaps scrap support for Isolated Storage in the .NET 3.5 version of Cassette? It's easy to use a regular file system directory (e.g. App_Data) instead.

Idiopathy answered 10/2, 2012 at 16:17 Comment(2)
So if I removed all the IsolatedStorage related classes/interfaces, that would be sufficient?Nacelle
Follow-up: we found Cassette did not even need to use LastFileWriteTime so we simply threw a NotImplementedException. Example of index file workaround: github.com/kamranayub/cassette/blob/…Nacelle

© 2022 - 2024 — McMap. All rights reserved.