System:Uint32^ in C++/CLI compiles to VaueType in C#?
问题 In a C++/CLI class library I have the following function: static System::UInt32^ Fn() { return gcnew System::UInt32(0); } When I use the class library in a C# the System::Uint32 is a System::ValueType and the compiler error: Error 1 Cannot implicitly convert type 'System.ValueType' to 'uint'. An explicit conversion exists (are you missing a cast?) Why is it that when I'm defiing a System::UInt32 in C++/CLI I get a ValueType in C#? Thanks 回答1: UInt32 is a value type ( struct in C#), not a