I am trying to get the current Hijri date in my Xamarin app.
I tried:
Calendar hijri = new HijriCalendar();
and
Calendar hijri = new HijriCalendar();
but getting:
Error CS0246: The type or namespace name 'HijriCalendar' could not be found (are you missing a using directive or an assembly reference?) (CS0246)
although I already added the:
using System.Globalization
HijriCalendar
is available in .NET Standard and not in old good PCL.
So update your project to latest and greatest .NET Standard 2.0:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<!--<PackageReference Include="" Version=""/>-->
</ItemGroup>
</Project>
Add back NuGets (simply open packages.config, and add the package references above, or via the NuGet package manager.
Delete AssemblyInfo.cs (this is now in the csproj) and packages.config (also in csproj via PackageReference)
Original gist.
If you are working with Visual Studio for Mac you can use an extension to convert the project type automatically.
P.S.: Alternatively as suggested by SushiHangover you can add a NuGet package. However, I would recommend to switch to .NET Standard asap.
P.S.S: More about .NET Standard here.