Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/287.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/visual-studio-2010/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 发生未知错误8004005_C#_Visual Studio 2010 - Fatal编程技术网

C# 发生未知错误8004005

C# 发生未知错误8004005,c#,visual-studio-2010,C#,Visual Studio 2010,当我在Visual studio for windows phone 2010中创建基本应用程序以链接到web浏览器,然后键入以下内容时 private void button1_Click(object sender, RoutedEventArgs e) { string site = textBox1.Text; webBrowser1.Navigate(new Uri(site, UriKind.Absolute)); } 当我构建应用程序时,它显示为成功。但

当我在Visual studio for windows phone 2010中创建基本应用程序以链接到web浏览器,然后键入以下内容时

private void button1_Click(object sender, RoutedEventArgs e)
{
    string site = textBox1.Text;    

    webBrowser1.Navigate(new Uri(site, UriKind.Absolute));
}
当我构建应用程序时,它显示为成功。但是,当我运行调试并启动仿真器时。当我按下按钮导航到一个特定的URL,比如google.com,这是我在文本框1中提到的文本,就会发生错误

System.SystemException
发生未知错误。错误:80004005

Uri
仅适用于一个完整的URL,以前面提到的方案开头,如
http://www.msn.com
我认为您应该使用
Uri.TryCreate()


URI需要方案类型(例如http://)。否则,您很可能会得到一个类似于相对URI的结果

使用,未指定方案时默认为http:

UriBuilder builder = new UriBuilder(textBox1.Text);
webBrowser1.Navigate(builder.Uri);

您如何格式化URL。。?你能说得更具体些吗。。?这听起来像是一个系统。绘图错误。。你甚至可以在它启动模拟器时调试它吗?你刚刚得到了所有有趣错误的根源。这里有一个链接可能会有所帮助。也可能不是。(是的,它指的是经典的asp,但大多数错误会直接转移到.Net)这是一个com例外--webBrowser1或您对它的调用出现问题。我正在使用Visual studio for windows phone 2010。我有一个文本框,就是代码中提到的文本框1。我已经在google.com的文本框中输入了,我还有一个按钮,就是按钮1,点击按钮,我要求它转到文本框1中提到的URL。当我构建应用程序时,构建成功。但是,当我尝试点击模拟器上的按钮时,会弹出visual studio 2010 express edition。我收到代码为8004005的错误未知错误这听起来像是库或dll被破坏了。我尝试过这样做,但同样的错误再次发生。无论如何,谢谢你的回复:)如果你这样做了
http://google.com
用原始代码取代文本框中的
google.com
,会发生什么?
UriBuilder builder = new UriBuilder(textBox1.Text);
webBrowser1.Navigate(builder.Uri);