有没有办法在可移植类库中使用GCHandle或在WP8中使用Marshal?

It'*_*ie. 7 c# portable-class-library windows-phone-8

我正在尝试在PCL中使用此代码,我希望在WP8应用程序中使用它:

internal static T ByteArrayToStructure<T>(byte[] bytes) where T : struct
{
    GCHandle handle = GCHandle.Alloc(bytes, GCHandleType.Pinned);
    T value = (T)Marshal.PtrToStructure(handle.AddrOfPinnedObject(),
        typeof(T));
    try {}
    finally { handle.Free(); }
    return value;
}
Run Code Online (Sandbox Code Playgroud)

但是,它没有注册GCHandleMarshal.有没有办法使用这些,或者在使用允许的类时是否有其他方法可以做到这一点?