[英]System assemblies not found for .Net v3.5 when starting new project or trying to open existing one
[英]MissingMethodException even when CF v3.5 is installed?
我正在尝试构建和运行一些专有库以在新的WinCE 5.0设备上工作。 我在其他(6.0)设备上使用了相同的代码,没有问题。 他们已经在世界各地从事生产工作,所以我确定我做错了什么。 :-)
当我编写最简单的代码时:
using System;
using System.Collections.Generic;
using System.Text;
namespace Contains
{
public class Program
{
static void Main(string[] args)
{
String target = "one";
String expose = "let me be the one";
Console.WriteLine(expose.Contains(target));
}
}
}
...在运行时,我得到了System.String.Contains的MissingMethodException。
我对此感到惊讶,因为msdn(http://msdn.microsoft.com/zh-cn/library/dy85x1sa(v=vs.80).aspx)表示该方法自.NET 2.0起就已包括在内。 无论以上代码是使用Framework版本2.0还是3.5,我都会收到相同的运行时异常报告。
FWIW,这不是似乎缺少的唯一方法,Environment.NewLine,StringBuilder.AppendFormat也抛出相同的运行时异常。
cgautil报告了设备上Compact Framework的[3.5.7283.0和2.0.7045.0]版本。
您能告诉我是否在代码文件之上添加了名称空间系统吗? 因为我看不到任何其他原因。 您只需要使用。
使用系统;
在代码文件的顶部,您可以使用它。 两者是否有3.5无关紧要。
用这个:
using System;
static void Main(string[] args)
{
string target = "one";
string expose = "let me be the one";
Console.WriteLine(expose.Contains(target));
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.