【发布时间】:2016-11-08 13:43:16
【问题描述】:
我目前正在逐字处理错误:
Assemblies 'C:\Users\Jake\Desktop\AudioFileSorter\AudioFileSorter\obj\Debug\Interop.QTOControlLib.dll' and 'C:\Users\Jake\Desktop\AudioFileSorter\AudioFileSorter\libs\Interop.QTOControlLib.dll' refer to the same metadata but only one is a linked reference (specified using /link option); consider removing one of the references.
我的参考资料包括几个文件:
AxInterop.QTOControlLib.dll
Interop.QTOControlLib.dll
Interop.QTOLibrary.dll
Interop.Shell32.dll
taglib-sharp.dll
这些文件都位于我的项目基本位置中名为 libs 的文件夹中并被引用:AudioFileSorter\AudioFileSorter\libs\
COM 引用中包含一个附加控件引用,即 Apple QuickTime Control 2.0。除了这个参考之外,所有其他参考都是通过在解决方案资源管理器中右键单击“参考”并单击“添加参考”然后浏览 libs 文件夹以提取 dll 文件来添加的。
显然,我不知道自己在做什么,也不知道如何解决。该项目昨天运行良好,在尝试将项目构建为发布版本之后,一切都搞砸了,现在我遇到了这个错误。我曾尝试删除其中一个重复引用,但当应用程序在此代码行期间调用它时,我最终只是丢失了该引用:
private void SortM4PFiles(string[] files)
{
WriteLine("Begin compiling .m4p files...");
foreach (string file in files)
{
axQTControl1.URL = file;
// Create new movie object
QTOLibrary.QTMovie mov = new QTOLibrary.QTMovie();
mov = axQTControl1.Movie;
string title = mov.Annotation[(int)QTAnnotationsEnum.qtAnnotationFullName];
string artist = mov.Annotation[(int)QTAnnotationsEnum.qtAnnotationArtist];
string album = mov.Annotation[(int)QTAnnotationsEnum.qtAnnotationAlbum];
songs.Add(new Song(title, album, artist, file));
songs[songs.Count - 1].setType(".m4p");
WriteLine("Evaluated " + title);
}
// Make sure the previous .m4p is not in use
// This will prevent an IOException when the file is in use and cannot be moved
axQTControl1.URL = "";
}
任何帮助或解释将不胜感激。谢谢。
This was the tutorial 用于使用 QuickTime 控件并读取 m4p 和 m4a 元数据。
【问题讨论】:
-
您必须选择直接使用互操作库或添加 COM 引用。后者几乎总是更好的选择,因为您可以确定它至少是您机器上的正确参考。请记住,Apple 停止了适用于 Windows 的 QuickTime,这并不是因为它曾经运行良好。你永远不想在你的用户机器上安装virus bait。有更好的方式来播放媒体,考虑 WMP。
-
@HansPassant 不幸的是,我不是在尝试播放媒体,而是在尝试从 m4p 和 m4a 文件中获取元数据,但我不确定如何在没有任何其他工具的情况下做到这一点......
-
@HansPassant 我有同样的错误,但在删除和添加 COM 引用半小时后无法弄清楚。我一直回来分析您上面的评论“您必须选择”,因为我知道您知识渊博。最终,我发现如果不是我的 COM 引用,它一定是其他一些引用区域。我最终在我的 NET 5 项目的程序集下找到了它(叹气)。感谢您的评论准确。
标签: c# visual-studio visual-studio-2015