Extension method not found

I have a file with an extension method that looks like this:

using System.Collections;
using UnityEngine;

public static class ExtensionMethods {
	// converts vector3 to vector2, discarding the parameter marked by discard; 0: discard x, 1: discard y, 2: discard z
	public static Vector2 AsVector2(this Vector3 v3, int discard) {
		Vector2 v2 = new Vector2();

		if (discard == 0) {
			v2.x = v3.y;
			v2.y = v3.z;
		} else if (discard == 1) {
			v2.x = v3.x;
			v2.y = v3.z;
		} else if (discard == 2) {
			v2.x = v3.x;
			v2.y = v3.y;
		}

		return v2;
	}
}

In of my scripts I try and use AsVector2 like this:

Vector3 v3 = rigidbody.velocity;
Vector2 v2 = v3.AsVector2(1);

However I get an error trying to do this: ‘Vector3’ does not contain a definition for ‘AsVector2’ and no accessible extension method ‘AsVector2’ accepting a first argument of type ‘Vector3’ could be found (are you missing a using directive or an assembly reference?)
What am I doing incorrectly?

All I’ve got is you either have:

  1. console compile errors

  2. the .cs file of extention methods in Editor folder