Ok, I see now that the issue is not that you're missing a reference. It's that you're either not using the function correctly, or Visual Studio doesn't know what the objects are that you're using in the function. Are you trying to compile or publish?
If you're trying to compile, you'll obviously need to resolve the errors before that can happen, but if you're updating the package through the Visual Editor, you can attempt to update and publish and see if the issues persist.