就像102中描述的那样从DllImportAttribute迁移到LibraryImportAttribute时,我偶然发现了DefaultDllImportSearchPathsAttribute,它指定了用于搜索DLC的路径.
假设我有以下DLC导入,
[DllImport("user32.dll")]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
private static extern bool RegisterHotKey(IntPtr hWnd, int id, int fsModifiers, int vk);
更新为
[LibraryImport("user32.dll")]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
private static partial bool RegisterHotKey(IntPtr hWnd, int id, int fsModifiers, int vk);
,搜索路径是否也会像以前那样由Library ImportProperty处理?