How do you fix "The script class couldn't be found" for an AssetPostProcessor DLL ?

I have created an AssetPostProcessor. In source code form, it works fine with no errors.

If I compile it to a DLL, Under Unity I get the following error:

“The script class couldn’t be found
UnityEngine.AnimationClip:SetCurve(String, Type, String, AnimationCurve)”

Is there a way to fix this error ?

I am using Xamarin Studio and followed the instructions and sample project here:

I am using the recommended project settings as indicated on the above site.

I have added the correct Unity DLL’s/.Net Assemblies: UnityEditor.dll, UnityEngine.dll.

The source files contain:
using UnityEditor;
using UnityEditor.Animations;
using UnityEngine;

In my case, this appears to be due to human error.

I was putting my AssetPostProcessor dll into a folder called “Editor”, and getting the strange error about the animation clip method not being found.

If I moved the dll to a folder called “Plugins”, it worked fine with no errors.

Remember kids, always put your dll’s, so’s and other dynamically linked objects into the appropriate folder.