Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception: 'The file is not a cloud file' #14

Open
csa89 opened this issue Jun 30, 2024 · 5 comments
Open

Exception: 'The file is not a cloud file' #14

csa89 opened this issue Jun 30, 2024 · 5 comments

Comments

@csa89
Copy link

csa89 commented Jun 30, 2024

Hi,

I encountered an issue while running the code to register a sync root using StorageProviderSyncRootManager.Register(storageInfo); in Registrar.cs line 336. The exception thrown is:
System.Exception: 'The file is not a cloud file. (Exception from HRESULT: 0x80070178)'

Steps Taken:

Verified that the folder exists and has the correct permissions.
Ran the application with administrative privileges.

Any insights or suggestions to resolve this issue would be greatly appreciated.

Thank you

@ITHitBuild
Copy link
Contributor

The line 336 in Registrar.cs is the call to

ValidateStorageProviderSyncRootInfo()

It does not look like this line can throw this exception.

Could you please provide:

  • The exception stack trace.
  • The version of the Engine that you are running.
  • Sample name that we can use to reproduce this issue.
  • .NET version.
  • Windows version.

@ITHitBuild
Copy link
Contributor

I can guess that there is something wrong with the folder that you are using. Please try any other folder to check.

Typically your folder will be somewhere under the C:\Users<user>\ folder. This location has necessary permissions by default and this is where OneDrive and SharePoint mount their root folder.

Please note that admin permissions are not required when registering. Typically you will install the application, register root and run your application with a regular user permissions, which provides higher security.

Please also note that our sample applications elevate permissions only to install the developer certificate, for demo purposes only. The root registration is done with a regular user rights in our samples.

@csa89
Copy link
Author

csa89 commented Jul 14, 2024

Yes, it worked directly on the C drive only. OneDrive worked on C:\Users\<user>\ folder, but StorageProviderSyncRootManager.Register(storageInfo) only worked for folders directly placed under the C drive.

@ITHitBuild
Copy link
Contributor

Unfortunately we were unable to reproduce the issue that you describe. Please provide:

  • The exception stack trace.
  • The version of the Engine that you are running.
  • Sample name that we can use to reproduce this issue.
  • .NET version.
  • Windows version.
  • Log file.

I can also guess that localization (OS language) may be causing this issue. We have recently seen issues with C:\Users<user>\ with some localizations on Windows 10 machines.

@csa89
Copy link
Author

csa89 commented Jul 15, 2024

please find below the requested information:

  • Exception stacktrace: at WinRT.ExceptionHelpers.<ThrowExceptionForHR>g__Throw|39_0(Int32 hr) at WinRT.ExceptionHelpers.ThrowExceptionForHR(Int32 hr) at ABI.Windows.Storage.Provider.IStorageProviderSyncRootManagerStaticsMethods.Register(IObjectReference _obj, StorageProviderSyncRootInfo syncRootInformation) at Windows.Storage.Provider.StorageProviderSyncRootManager.Register(StorageProviderSyncRootInfo syncRootInformation) at ITHit.FileSystem.Samples.Common.Windows.Registrar.<RegisterAsync>d__9.MoveNext() in C:\Users\myuser\Desktop\UserFileSystemSamples-master\Windows\Common\Core\Registrar.cs:line 338 at ITHit.FileSystem.Samples.Common.Windows.Registrar.<RegisterSyncRootAsync>d__3.MoveNext() in C:\Users\myuser\Desktop\UserFileSystemSamples-master\Windows\Common\Core\Registrar.cs:line 63 at VirtualFileSystem.Program.<Main>d__7.MoveNext() in C:\Users\myuser\Desktop\UserFileSystemSamples-master\Windows\VirtualFileSystem\Program.cs:line 75

  • Engine version: 8.1.26901.0

  • .NET version: .NET 8.0.7 64bit

  • Windows version: Microsoft Windows 11 Pro, Version: 23H2, OS build: 22631.3880. (VirtualFileSystem project output is showing windows 10 instead of 11)

  • Sample name: i am running the cloned project from this repo, project name: VirtualFileSystem

  • Logs: app.log

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

No branches or pull requests

2 participants