We have a VC++ project for CLR which is compiling properly in VS 2012. But getting the following exception during runtime:
"Could not load type 'System.Int32[]&' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'"
Following is the code:
------------------------------------------------------------
// ClassLibrary1.h
#pragma once
using namespace System;
using namespace System::Runtime::InteropServices;
namespace ClassLibrary1 {
//template <typename T>
class ArgOutValueArray
{
public:
ArgOutValueArray(int (__gc* __nogc& aRef) __gc[] )
{
//(*x)[0] = 100;
}
};
public __gc class Class1
{
public:
static void f1([Out] int (*x) __gc[])
{
f2(x);
}
static void f2([Out] int (*x) __gc[])
{
ArgOutValueArray arg_xeqp(x); // Getting the exception at this line.
}
};
}
-------------------------------------------------------------------