Delphi コントロール内で WPF コントロールを作成およびホストできる Delphi win32 アプリケーションで CLR 2.0 をホストすることができました。これは、WinForms アプリケーションの ElementHost に似ています。
ここで、ソリューションを CLR 4.0 に移行したいと考えています。関連付けられた Xaml リソースを持つ UserControl を作成しようとする場合を除いて、すべて正常に動作します。その場合、スタック オーバーフロー エラーが発生し、プロセスが強制的に終了されます。しかし、(xaml を読み取らずに) コードで WPF コントロールを作成すると、すべて正常に動作します。
XamlReader.LoadBamlメソッドに入るまでフレームワーク コードにステップ インすることができましたが、次のコードを実行した直後にクラッシュしました。
// We don't actually use the GeneratedInternalTypeHelper any more.
// But for v3 compat, don't allow loading of internals in PT unless there is one.
Type internalTypeHelper = null;
if (streamInfo.Assembly != null)
{
try
{
internalTypeHelper = XamlTypeMapper.GetInternalTypeHelperTypeFromAssembly(parserContext);
}
// This can perform attribute reflection which will fail if the assembly has unresolvable
// attributes. If that happens, just assume there is no helper.
catch (Exception e)
{
if (MS.Internal.CriticalExceptions.IsCriticalException(e))
{
throw;
}
}
}
読み込まれたアセンブリも CLR4 を使用することに注意してください。
ご協力いただきありがとうございます、
モーガン