LastModifiedDate on Fileinfo gives error

Hello,

I have newly upgrade to the latest version of studio. In doing so it broke my

FileInfo.LastModifiedDate

Errorcode: " error BC30456: ‘LastModifiedDate’ is not a member of ‘FileInfo’."

Does anyone know how to get the last modified date in another way?

Hi @Ninjabullen

Can you please verify whether you have the System.IO namespace available or not in the Imports panel? If not, please import the same.

Hope this helps,
Best Regards.

Seems like it

image

Here is the assign if that makes any difference:

1 Like

Hi,
You can assign the fileInfo to a varaiable of type FileInfo and then can access the lastModifiedDate of that variable not directly from FileInfo. Screenshot below shows:

1 Like

@Ninjabullen

You can use this expression to get the last modified time:

IO.File.GetLastWriteTime(yourFilePath)

image

Hope this helps,
Best Regards.

1 Like

Perhaps there’s a conflict between the variable “FileInfo” and the class “FileInfo”. Could you try renaming your “FileInfo” variable to something else?

1 Like

That does not seem to work:

Is there a difference between getlastwritetime and lastmodifieddate?

The variable used on the left, “FileInfo”, could you rename it to something else, just for testing? Like call it “MyFileInfoVar” or something.

Good thought, sadly nothing changed:

@Ninjabullen

It does not make much difference. There are only some fundamental differences in the metadata presented by both functions but GetaLastWriteTime seems to be giving the last modified date & time pretty accurate.

Best Regards.

1 Like

I will try this and get back with result :slight_smile:

1 Like

Hi @Ninjabullen - Did you try removing the entire expression, wait for a min, and type everything manually again

It works perfectly. Thanks for the solution.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.