M
mike
I'd like to port some C++ code to a .NET ClassLib for C# consumers.
Am using VC2005, .NET 2.0
However I find that If I simply generate a C++ ClassLib using the wizard...
// SimpleCLib.h
#pragma once
using namespace System;
namespace SimpleCLib {
public ref class Class1
{
// TODO: Add your methods for this class here.
};
}
Then generate a C# console app, add the Lib Reference and a new instance of Class1 it generates a runtime error. The error is 'System.BadImageFormatException'
using System;
using System.Collections.Generic;
using System.Text;
namespace CSharpConsoleTest {
class Program
{
static void Main(string[] args)
{
SimpleCLib.Class1 scl = new SimpleCLib.Class1;
}
}
}
After some investigation, I am not seeing anything other than verifying /FIXED:no setting in the linker.
Any help would be appreciate, thanks - Mike
Am using VC2005, .NET 2.0
However I find that If I simply generate a C++ ClassLib using the wizard...
// SimpleCLib.h
#pragma once
using namespace System;
namespace SimpleCLib {
public ref class Class1
{
// TODO: Add your methods for this class here.
};
}
Then generate a C# console app, add the Lib Reference and a new instance of Class1 it generates a runtime error. The error is 'System.BadImageFormatException'
using System;
using System.Collections.Generic;
using System.Text;
namespace CSharpConsoleTest {
class Program
{
static void Main(string[] args)
{
SimpleCLib.Class1 scl = new SimpleCLib.Class1;
}
}
}
After some investigation, I am not seeing anything other than verifying /FIXED:no setting in the linker.
Any help would be appreciate, thanks - Mike