CS1703: In Xamarin.Droid, should I use the .Net Standard windowsruntime.dll located in Mono.Framework, or System.Runtime?

北城余情 提交于 2019-12-10 18:30:24

问题


I'm trying to build this Android Xamarin project, and am getting the compile time error:

./ResilientServices/ResilientServices.Droid/CSC: 
  Error CS1703: Multiple assemblies with equivalent identity have been imported:

./ResilientServices/packages/System.Runtime.InteropServices.WindowsRuntime.4.0.1/lib/netstandard1.3/System.Runtime.InteropServices.WindowsRuntime.dll'
 and  
./Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.Runtime.InteropServices.WindowsRuntime.dll'. 

 Remove one of the duplicate references. (CS1703) (ResilientServices.Droid)

回答1:


Ran into this just this week. No idea what change caused it.

What worked for me was commenting out the HintPath in the .csproj Reference:

<Reference Include="System.Runtime.InteropServices.WindowsRuntime">
    <!--HintPath>..\..\packages\System.Runtime.InteropServices.WindowsRuntime.4.0.1\lib\netstandard1.3\System.Runtime.InteropServices.WindowsRuntime.dll</HintPath-->
    <Private>True</Private>
</Reference>

Duplicate question here, btw.



来源:https://stackoverflow.com/questions/45862676/cs1703-in-xamarin-droid-should-i-use-the-net-standard-windowsruntime-dll-loca

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!