TypeLoadException When Calling WinRT Component

Category: windows metro apps games

Question

soggy.potato on Sun, 22 Apr 2012 18:29:30


I have created C++ WinRT component that wraps DirectX. Then, I tried to access from my C# application and it gave me a TypeLoadException.

Replies

Jesse Jiang on Mon, 23 Apr 2012 08:14:29


Hello,

Would you please provide us some same codes to reproduce this issue?

You can upload your project to
http://skydrive.live.com/

It is not necessary that you send out the whole of your project. We just need a simplest sample to reproduce the problem. You can remove any confidential information or business details from it.

Or you can try the way combing XAML and Direct X in this blog
http://blogs.msdn.com/b/windowsappdev/archive/2012/03/15/combining-xaml-and-directx.aspx

Best regards,
Jesse

soggy.potato on Fri, 27 Apr 2012 22:28:37


Here is my project:

https://skydrive.live.com/redir.aspx?cid=b873c6895db8fce2&resid=B873C6895DB8FCE2!2171&parid=B873C6895DB8FCE2!103&authkey=!ACmEtVq3PfDinvc

The MetroXna project is the winrt component and MetroXna.Tests is the C# application that throws a TypeLoadException


Joaquin Jares on Thu, 12 Jul 2012 13:44:48


I think I may be having a similar problem (a Xaml app using a WinRT C# component throws a TypeLoadException that doesn't really make much sense). Was this ever resolved?

Joaquin Jares on Thu, 12 Jul 2012 13:47:56


Nevermind. The problem was that I was using a namespace that didn't match the assembly name. That's not legal in WinRT, it seems. Problem solved!!