まず、私は使用する必要のあるサードパーティ製のActiveXコントロールがあります。Interop警告を埋め込むことはできません
次は、第三者のコントロールにいくつかの画像を供給するためにstdoleライブラリを使用する必要があります。私はデフォルトの設定でコンパイルすると 、私はいくつかの警告が出ます:十分な
warning CS1762: A reference was created to embedded interop assembly 'c:\Windows\assembly\GAC\stdole\7.0.3300.0__b03f5f7f11d50a3a\stdole.dll' because of an indirect reference to that assembly created by assembly 'XXX\obj\x86\Release\Interop.ThirdPartyControl.dll'. Consider changing the 'Embed Interop Types' property on either assembly.
warning CS1762: A reference was created to embedded interop assembly 'c:\Windows\assembly\GAC\stdole\7.0.3300.0__b03f5f7f11d50a3a\stdole.dll' because of an indirect reference to that assembly created by assembly 'XXX\obj\x86\Release\AxInterop.ThirdPartyControl.dll'. Consider changing the 'Embed Interop Types' property on either assembly.
簡単に、私はstdole参考のために偽へのアドバイスと設定埋め込み相互運用機能の種類をたどるだろう。だから、
Could not load file or assembly 'stdole, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
stdoleに埋め込み相互運用機能を削除するなぜ私はよく分からないが、私は(それが起こらないつもりだと思う持っている:私は今、クライアントマシンに移動するまで、すべてが突然、アプリケーションがこれを投げている時に、よさそうですライブラリを完全に無意味にする効果)。
もう一度、Embed Interopですべてをマークしてみましょう。 コンパイルエラー:
Error 2 Cannot embed interop types from assembly 'XXX\obj\x86\Release\AxInterop.ThirdPartyControl.dll' because it is missing either the 'ImportedFromTypeLibAttribute' attribute or the 'PrimaryInteropAssemblyAttribute' attribute XXX\obj\x86\Release\AxInterop.ThirdPartyControl.dll XXX
Error 1 Cannot embed interop types from assembly 'XXX\obj\x86\Release\AxInterop.ThirdPartyControl.dll' because it is missing the 'GuidAttribute' attribute XXX\obj\x86\Release\AxInterop.ThirdPartyControl.dll XXX
したがって、警告を取り除き、何かを構築して実行する方法についてのアドバイスはありますか?
UPDATE
ハンスアンパッサンは、コメントとして実際に問題を解決しない答えを掲載しました。彼が答えとしてそれを再投稿すれば、私はそれを受け入れるでしょう。残念ながら私はまた、ローカルコピーに設定されているDLLがプロジェクトのリリースフォルダにうまくコピーされるが、ソリューションの最終リリースフォルダ(別の実行可能ファイル)に移動しないという標準的な問題も抱えています。私は実行可能ファイルにstdoleへの参照を追加することでこれを解決しました。おそらくそれで十分だろう。
ActiveXコンポーネントにタイプを埋め込むことはできません。ターゲットマシンにPIAが標準でない場合は、ローカルコピープロパティをtrueに設定して、生成されたstdole.dllもコピーしてみてください。 –
もう一度Hans Passant!あなたはどこにいても、今日は無関係なものであなたを見つけました。なぜJon Skeetがすべてのプレスを手に入れるのか分かりません。私はそれを試してみて、報告します。 – user12861
@HansPassant質問への更新を見る – user12861