Issue
This code used to work, but after installing Visual Studio for Mac 2022 it doesn't work anymore:
var dlg = NSOpenPanel.OpenPanel;
dlg.AllowsMultipleSelection = false;
dlg.CanChooseFiles = false;
dlg.CanChooseDirectories = true;
if (dlg.RunModal() == 1)
{
if (dlg.Url != null)
{
NSError error = new NSError();
string[] resourceValues = { };
var data = dlg.Url.CreateBookmarkData(NSUrlBookmarkCreationOptions.WithSecurityScope, resourceValues, null, out error);
var userDefaults = NSUserDefaults.StandardUserDefaults;
userDefaults.SetValueForKey(data, new NSString("MBVFolderBookmark"));
}
}
The error parameter is {The file couldn’t be opened.} The same error show with files or folders.
Other options of NSUrlBookmarkCreationOptions still works.
What can it be?
Solution
I seems that my certificate (developer ID) was expired. Creating a new one did solve this problem...
Answered By - Marcel de Graaf
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.