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
テストのためだけに、新しいプロジェクトを作成してそこにコードをコピーして貼り付けます。 –