According to the error the line of code causing the null reference is; using (Stream stream = assembly.GetManifestResourceStream(resourceName)). I assume you are missing the embedded resource in your project.
public static bool IsLicensed(string key, string resourceName)
{
string[] licenseKeys;
var assembly = Assembly.GetExecutingAssembly();
using (Stream stream = assembly.GetManifestResourceStream(resourceName))
using (StreamReader reader = new StreamReader(stream))
{
licenseKeys = reader.ReadToEnd().Split(Environment.NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
}
using (MD5 md5Hash = MD5.Create())
{
if (licenseKeys.Contains(GetMd5Hash(md5Hash, key)))
{
return true;
}
else
{
return false;
}
}
}
You really should learn how to user the Visual Studio debugger to review your code. the next step is to review the WPF application to find the resource and use the same in your project. You can do a Google search if you are unsure how to use resources in Web Forms.