程序集引用相同的元数据,但只有一个是链接引用;考虑删除其中一个引用 [英] Assemblies refer to the same metadata but only one is a linked reference; consider removing one of the references

查看:41
本文介绍了程序集引用相同的元数据,但只有一个是链接引用;考虑删除其中一个引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在逐字处理错误:

程序集 'C:\Users\Jake\Desktop\AudioFileSorter\AudioFileSorter\obj\Debug\Interop.QTOControlLib.dll' 和 'C:\Users\Jake\Desktop\AudioFileSorter\AudioFileSorter\libs\Interop.QTOControlLib.dll' 引用相同的元数据,但只有一个是链接引用(使用/link 选项指定);考虑删除其中一个引用.

我的参考资料包括几个文件:

AxInterop.QTOControlLib.dll互操作性QTOControlLib.dll互操作性QTOLibrary.dll互操作.Shell32.dlltaglib-sharp.dll

这些文件都位于我的项目的基本位置中名为 libs 的文件夹中并被引用:AudioFileSorter\AudioFileSorter\libs\

来自 COM 参考的附加控件参考作为 Apple QuickTime Control 2.0 包含在内.除了这个引用之外,所有其他引用都是通过在解决方案资源管理器中右键单击引用"并单击添加引用"然后浏览 libs 文件夹以提取 dll 文件来添加的.

显然,我不知道自己在做什么,也不知道如何解决.该项目昨天运行良好,在尝试将项目构建为发布版本后,一切都搞砸了,现在我遇到了这个错误.我曾尝试删除其中一个重复的引用,但是当应用程序在此代码行中调用它时,我最终只是错过了引用:

private void SortM4PFiles(string[] files){WriteLine("开始编译 .m4p 文件...");foreach(文件中的字符串文件){axQTControl1.URL = 文件;//创建新的电影对象QTOLibrary.QTMovie mov = 新的 QTOLibrary.QTMovie();mov = axQTControl1.Movie;字符串标题 = mov.Annotation[(int)QTAnnotationsEnum.qtAnnotationFullName];字符串艺术家 = mov.Annotation[(int)QTAnnotationsEnum.qtAnnotationArtist];字符串专辑 = mov.Annotation[(int)QTAnnotationsEnum.qtAnnotationAlbum];歌曲.添加(新歌曲(标题,专辑,艺术家,文件));歌曲[songs.Count - 1].setType(".m4p");WriteLine("已评估" + title);}//确保之前的 .m4p 没有被使用//这将在文件正在使用且无法移动时防止 IOExceptionaxQTControl1.URL = "";}

任何帮助或解释将不胜感激.谢谢.

I am currently dealing with the error word for word:

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.

My references include several files:

AxInterop.QTOControlLib.dll
Interop.QTOControlLib.dll
Interop.QTOLibrary.dll
Interop.Shell32.dll
taglib-sharp.dll

These files are all located and referenced from a folder called libs within the base location for my project: AudioFileSorter\AudioFileSorter\libs\

An additional control reference was included as the Apple QuickTime Control 2.0 from the COM references. With the exception of this reference all other references were added by right clicking 'References' in the Solution Explorer and clicking 'Add Reference' and then browsing the libs folder to pull dll file.

Obviously, I have no idea what I am doing and I don't know how to solve it. The project worked fine yesterday and after trying to build the project to a release build everything got messed up and now I have this error. I have tried removing one of the duplicate references but then i end up just missing the reference when the app calls it during this code line:

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 = "";
}

Any help or explanation would be greatly appreciated. Thank you.

This was the tutorial for using the QuickTime control and reading m4p and m4a metadata.

解决方案

I was trying to convert one project from packages.config to PackageReference... & I got this issue. After looking into it, I realized that, there are two references added for the same dll.

How? One from nuget & one from local COM dll. I had remove one reference to fix the issue.

这篇关于程序集引用相同的元数据,但只有一个是链接引用;考虑删除其中一个引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆