4

有人看过以下内容并知道解决方法吗?

问题

如果我有多个解决方案,每个解决方案都有多个项目。我看到的是无法解析程序集引用。这似乎发生在我之前有一个已构建但缺少参考的开放解决方案(我忘记构建它)时。然后我打开将构建缺少的引用的解决方案并进行构建。有时即使认为过去已经成功构建,该解决方案也无法构建。

错误信息

我看到的是以下内容:

Target ResolveAssemblyReferences:
/Library/Frameworks/Mono.framework/Versions/3.2.6/lib/mono/4.0/Microsoft.Common.targets:  warning : Reference ‘xxxx, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL' not resolved
    For searchpath {CandidateAssemblyFiles}
    Warning: {CandidateAssemblyFiles} not supported currently
    For searchpath {HintPathFromItem}
    For searchpath {TargetFrameworkDirectory}
    Considered target framework dir /Library/Frameworks/Mono.framework/Versions/3.2.6/lib/mono/4.5, assembly named ‘xxxx' not found.
    Considered target framework dir /Library/Frameworks/Mono.framework/Versions/3.2.6/lib/mono/4.5/Facades/, assembly named ‘xxxx' not found.
    For searchpath {PkgConfig}
    Considered xxxx, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL, but could not find in any pkg-config files.
    For searchpath {GAC}
    Considered xxxx, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL, but could not find in the GAC.
    For searchpath {RawFileName}
    For searchpath ../../../bin/    <— This is where the xxxx.dll is but it doesn’t find it

现在,如果我“退出 Xamarin”并在新的 xamarin 窗口中重新打开解决方案并进行构建,则该程序集的上述错误将消失,但如果它有其他依赖于它的项目,它们将失败。例如,如果我的解决方案包含三个具有以下依赖项的项目:

zzzz.dll depends on yyyy.dll depends on xxxx.dll

我看到的是 yyyy.dll 的构建将失败,上面的错误说它找不到 xxxx.dll。

使用相同的解决方案退出并重新打开 Xamarin 的新版本,只需构建 xxxx.dll 和 yyyy.dll 都将构建解决方案,但 zzzz.dll 将失败,说它找不到 yyyy.dll。

现在退出并使用相同的解决方案重新打开新版本的 Xamarin,只需构建解决方案,所有三个项目都将成功构建。

现在,如果我退出并使用缺少引用的原始解决方案重新打开 Xamarin,那么它将找到程序集。但是,如果它有多个相互依赖的项目(没有循环依赖关系),那么我必须经历与项目一样多的退出和重新打开序列(减去一个,因为第一个项目似乎总是在构建)。

4

0 回答 0