1
using System;
using System.Collections;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.InteropServices.CustomMarshalers;
namespace mshtml
{
[DefaultMember("item"), CompilerGenerated, Guid("3050F21F-98B5-11CF-BB82-00AA00BDCE0B"), TypeIdentifier]
[ComImport]
public interface IHTMLElementCollection : IEnumerable
{
void _VtblGap1_3();
[DispId(-4)]
[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(EnumeratorToEnumVariantMarshaler))]
IEnumerator GetEnumerator();
}
}
上面的代碼中存在給了我以下錯誤:錯誤CS0234:類型或命名空間名稱「CustomMarshalers」不存在命名空間「System.Runtime.InteropServices」
Error CS0234: The type or namespace name 'CustomMarshalers' does not exist in the namespace 'System.Runtime.InteropServices' (are you missing an assembly reference?)
Pleae告知如何固定?這是一個反編譯的代碼,我是C#的初學者。
我只是將你的代碼複製粘貼到一個新的項目中,並且都很好。沒有錯誤。在你的項目中可能缺少一些DLL引用? –
不確定,我錯過了什麼 – Web
僅用於測試,只需創建一個新項目並將代碼複製粘貼到那裏。 –