开发者

CSharpCodeProvider fails to compile function but Visual studio compiles the same function

开发者 https://www.devze.com 2023-01-03 06:22 出处:网络
Here\'s a simple function. Compiling t开发者_如何学运维his code using the CSharpCodeProvider fails but it works when I attempt to reproduce the problem using Visual studion. The error I get is \"unabl

Here's a simple function. Compiling t开发者_如何学运维his code using the CSharpCodeProvider fails but it works when I attempt to reproduce the problem using Visual studion. The error I get is "unable to implicitly convert uint? to uint". Any ideas ?

public static Boolean Func1() { UInt32? x = 0; UInt32? y = 0; return x == (UInt32?)0; }


Which version of VS are you using? I guess VS 2008.

Have you tried to force the compiler version to be used? IIRIC, by default C# 2.0 will be used (even in a C# 3.0 app).

For more information see here.

0

精彩评论

暂无评论...
验证码 换一张
取 消