I'm building a multi-platform class library with Xamarin. The Android project builds with no problem. But the iOS project gives me a bunch of errors like this, for various
error CS0012: The type 'System.IDisposable' is defined in an assembly that is not referenced. Consider adding a reference to assembly 'netstandard, Version=18.104.22.168, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
This happens regardless of whether I build via Visual Studio, or on the command line with
My .csproj has these framework references and package references:
<ItemGroup> <Reference Include="System" /> <Reference Include="System.Xml" /> <Reference Include="System.Core" /> <Reference Include="System.Net.Http" /> <Reference Include="Xamarin.iOS" /> <PackageReference Include="Common.Logging" Version="3.4.1" /> <PackageReference Include="Xamarin.Essentials" Version="0.8.0-preview" /> <PackageReference Include="Xam.Plugin.DeviceInfo" Version="22.214.171.124" /> <PackageReference Include="My.Other.Library" Version="1.0.2" /> </ItemGroup>
My.Other.Library is not an iOS project; it has targets of
net45. I'm guessing that that is not the problem, because the same library is also used by my Android project, which works fine.
Currently these two projects have the same code - that is, they both compile the same
.cs files from a shared directory, except for
AssemblyInfo.cs which exists separately in each project. They also have the same assembly references, except that the Android project uses
Mono.Android rather than
I'm using Mac Visual Studio Community 7.5.2.