C# [HttpGet] public async Task>で出力をしようとしてるのにエラー
よくわかっていませんが
<Error> <Message>An error has occurred.</Message> <ExceptionMessage>The 'ObjectContent`1' type failed to serialize the response body for content type 'application/xml; charset=utf-8'.</ExceptionMessage><ExceptionType>System.InvalidOperationException</ExceptionType> <StackTrace/> <InnerException> <Message>An error has occurred.</Message> <ExceptionMessage>型 '<>f__AnonymousTypeb`3[System.Int32,System.Int32,System.String]' をシリアル化できません。この型を DataContractAttribute 属性でマークするか、シリアル化するすべてのメンバーを DataMemberAttribute 属性でマークしてください。この型がコレクションの場合は、CollectionDataContractAttribute 属性でマークすることを検討してください。その他のサポートされている型については、Microsoft .NET Framework のマニュアルを参照してください。</ExceptionMessage>
このメッセージはFirefoxで直接アクセスしたから
直接アクセスするのはInternetExplorerで実行すれば言われない
ForefoxのAcceptヘッダー
text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
InternetExplorerのAcceptヘッダー
text/html, application/xhtml+xml, */*
application/xmlが邪魔するみたい。。。。
ので、FirefoxでもAcceptヘッダーからapplication/xmlを削除すればなんとかなります。
orz..