Hello everyone.

The Mixed Reality Forums here are no longer being used or maintained.

There are a few other places we would like to direct you to for support, both from Microsoft and from the community.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.

If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.

And always feel free to hit us up on Twitter @MxdRealityDev.
Options

CopyAsync

I'm getting a NotImplementedException whenever StorageFile.CopyAsync is called. Is this part of the API not finished yet? For reference, I'm using Visual Studio Professional 2015 with update 3 and Hololens OS version 10.0.14342.1016.

Answers

  • Options

    The following code for me executed with no exceptions:

    create_task(Windows::Storage::StorageFolder::GetFolderFromPathAsync(Windows::ApplicationModel::Package::Current->InstalledLocation->Path + L"\\Assets\\Models")).then([this](Windows::Storage::StorageFolder^ folder) { auto fileTask = create_task(folder->GetFileAsync(L"gaze_cursor.cmo")).then([this, folder](Windows::Storage::StorageFile^ file) { auto copyTask = create_task(file->CopyAsync(folder, L"copy.cmo", Windows::Storage::NameCollisionOption::ReplaceExisting)); }); });

    Visual Studio Enterprise Update 3
    OS Build 10.0.14342.1016
    Firmware Rev: 0005.05.M.1604281147R
    Deployed/debugged via USB

  • Options

    I forgot to specify that the exception is thrown when there is an existing file with the same name. The function works as expected on the other platforms we support. The code is:

    await file.CopyAsync(existingFolder, newName, NameCollisionOption.ReplaceExisting);

  • Options
    You'll see in my example that I used that option. It did work for me.
  • Options
    Perhaps there is some underlying difference between C# and C++/CX.
  • Options

    Chris - I'm getting the same issue. CopyAsync throws a NotImplementedException if the file already exists. Did you ever find a solution for this? I'm using C++.

Sign In or Register to comment.