I am writing a Web API project (MVC architecture). I have a utility class with methods that returns an HttpResponseMessage. If this class is placed in a Utility folder everything works. If I attempt to place the class within the App_Code folder, I receive the message "The type or namespace name 'HttpResponseMessage' found not be found."
An example of a method that this occurs with is provided below. What needs to be done to be able to declare a variable or method as HttpResponseMessage within the App_Code folder?
public HttpResponseMessage GetResponseMessage<T>(T item, MediaTypeFormatter mtFormatter)
{
HttpResponseMessage response = new HttpResponseMessage()
{
Content = new ObjectContent<T>(item, mtFormatter)
};
return response;
}