运行ASP.NET C#应用程序的问题 [英] Problem running ASP.NET C# application

查看:81
本文介绍了运行ASP.NET C#应用程序的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读乞求ASP.NET for Visual Studio 2015.他们的论坛已经死了,没有任何帮助,我不知道如何研究这个问题,因为我以前从未遇到过它。

我一直在构建练习应用程序,本书引导我完成并且从未遇到过运行我的应用程序的问题,但是在我完成最后一次练习之后,当我尝试运行我的应用程序我得到错误服务器错误'/'应用程序



我的浏览器中的消息如下:



Im reading Begging ASP.NET For Visual Studio 2015. Their forum is dead and of no help and I`m not sure how to even research this problem because Ive never come across it before.
I`ve been building the practice application that the book walk me through and have never had a problem running my application, however after I finished the last exercise following everything to the "t" when I try to run my app I get and error "Server Error In '/' Application

The message in my browser is as follows:

Server Error in '/' Application.

Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. 

Parser Error Message: Unable to connect to any of the specified MySQL hosts.

Source Error: 


Line 283:    <sitemap>
Line 284:      <providers>
Line 285:        <add name="MySqlSiteMapProvider" type="MySql.Web.SiteMap.MySqlSiteMapProvider, MySql.Web, Version=6.9.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" connectionStringName="LocalMySqlServer" applicationName="/" />
Line 286:      
Line 287:    

Source File: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config    Line: 285 

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1586.0





正如我所说,这是第一次我有这个错误的时间,不知道如何搜索这个。背后的所有代码都是C#



我尝试过:



我不知道该尝试什么?它是一个sql错误但它以前一直有效。当我运行这个应用程序时,我没有改变它引用的页面中的任何内容和visual studio没有错误或警告



As I`ve said this is the first time I have had this error and have no idea how to even search this. All the code behind is C#

What I have tried:

I don`t know what to try? Its an sql error but it has always worked before. I havent altered anything in the page its referring to and visual studio has no errors or warnings when I run this application

推荐答案

当我在学习从ASP.NET 4.5.1开始:在C#和VB 中。幸运的是,用户 zinedu5 发布了一个对我有用的解决方案,可以在这里找到:



第7章:配置错误 [ ^ ]



您必须将以下代码添加到web.config文件中:



The same problem occurred when I was studying Beginning ASP.NET 4.5.1 : in C# and VB. Fortunately, user zinedu5 posted a solution that worked for me, that can be found here:

Chapter 7: Configuration Error[^]

You have to add the following code to the web.config file :

<system.web>
 ...
  <siteMap>
    <providers>   
        <remove name="MySqlSiteMapProvider" />
    </providers>
  </siteMap>
</system.web>



希望这对您也有用!


Hope this works for you as well!


查看错误消息:

Look at the error message:
Unable to connect to any of the specified MySQL hosts.

它可能不是很清楚 - 你正在尝试连接到MySql不存在的服务器。

猜测,你没有改变示例代码来解决你的实际安装 - 你不能指望这个例子(必须是每个读取的人)这本书)提前知道你的具体连接和登录详情是什么!

It couldn't be a lot clearer - you are trying to connect to a MySql server which doesn't exist.
At a guess, you haven't alters the example code to address your actual installation - and you can't expect the example (which has to be for everyone who reads the book) to know in advance what your specific connection and login details are!


谢谢。你做了我的一天..从2天开始苦苦挣扎..

我使用sqlserver而错误报告与MySQL有关。
Thanks. u made my day..struggling since 2 days..
I was using sqlserver whereas error reporting related to MySQL.


这篇关于运行ASP.NET C#应用程序的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆