ContentManager not loading content

Hi there,

I’m having a strange problem when trying to load in a content using a resource manager. When I try load one of two things happens. Either the load function throws an exception saying there’s no graphics device service or it doesn’t return and doesn’t allow me to view the object using vs debugging tools. Any help would be much appreciated.

Resource:

public class Resource {

    private string _path;

    public string Path {
        get { return _path; }
        set { _path = value; }
    }

    public Type Type {
        get { return typeof(T); }
    }

    public T Value {
        get { return ResourceManager.GetResource<T>(_path); }
    }

    public Resource(string path) {
        _path = path;
    }

    public static implicit operator string(Resource<T> resource) {
        return resource.Path;
    }
} 

ResourceManager

public class ResourceManager {

    static ContentManager _content;
    static Dictionary<string, object> _resources;

    public static void Initialize (ContentManager content) {
        _content = content;
        _resources = new Dictionary<string, object>();
    }

    public static T GetResource<T>(string path) {
        if (_resources.ContainsKey(path))
            return (T)_resources[path];

        T item = _content.Load<T>(path);
        _resources.Add(path, item);

        return item;
    }

    public static void Release () {
        _resources.Clear();
        _content.Unload();
    }
}