Feature `type pattern matching' cannot be usedSolved

Getting the error "CS1644: Feature `type pattern matching' cannot be used because it is not part of the C# 6.0 language specification" when I load my plugin onto the server. I've narrowed it down to this section of code that causes it. I'm not getting any errors in visual studios, if anyone knows how to fix this error it would be greatly appreciated

[ChatCommand("fill")]
private void fillwater(ConsoleSystem.Arg arg, BasePlayer basePlayer)
{
	int num = arg.GetString(0, "").ToLower() == "salt" ? 1 : 0;
	ItemDefinition itemDefinition = ItemManager.FindItemDefinition(num != 0 ? "water.salt" : "water");
	for (int slot = 0; slot < PlayerBelt.MaxBeltSlots; ++slot)
	{
		Item itemInSlot = basePlayer.Belt.GetItemInSlot(slot);
		if (itemInSlot != null && itemInSlot.GetHeldEntity() is BaseLiquidVessel heldEntity && heldEntity.hasLid)
		{
			int amount = 999;
			ItemModContainer component;
			if (heldEntity.GetItem().info.TryGetComponent<ItemModContainer>(out component))
				amount = component.maxStackSize;
			heldEntity.AddLiquid(itemDefinition, amount);
		}
	}
}
You cannot do `x is Y variableName`, lower your project C# version to 6.0.
sorry to bother again, but I've been looking everywhere and can't seem to find out how you actually change to version 6.0, the option under build - advanced is blocked, and I've tried changing my framework to 4.6, but am still getting the error.
Language version, not Framework.

Change:

if (itemInSlot != null && itemInSlot.GetHeldEntity() is BaseLiquidVessel heldEntity && heldEntity.hasLid)

To:

BaseLiquidVessel heldEntity = itemInSlot?.GetHeldEntity() as BaseLiquidVessel;
if (heldEntity != null && heldEntity.hasLid)
Locked automatically