web.config文件变更指南 [英] web.config file changings guide

查看:58
本文介绍了web.config文件变更指南的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,你们好吗?我是学生,并使用sql server 2005学习asp.net c#visual studio 2010.我开发了一个拥有数据库的网站。我开发了这个网站,自学从互联网上获取帮助。网站已经完成并在我的电脑上完美运行。



我已经注册了托管服务器和域名。



问题是当我上传我的网站时它不起作用,显示以下错误:



Hi experts how are you all? i am student, and learning asp.net c# visual studio 2010 with using sql server 2005. I have developed a website which has database. I developed this website with self studies taking help from internet. the website is completed and working perfectly in my computer.

I have hosting server and domain name registered already.

the problem is when I upload my website it doesn't work there the following error displays:

Server Error in '/' Application.

Runtime Error

Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine. 

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".


<!-- Web.Config Configuration File -->

<configuration>
    <system.web>
        <customErrors mode="Off"/>
    </system.web>
</configuration>

Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.


<!-- Web.Config Configuration File -->

<configuration>
    <system.web>
        <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
    </system.web>
</configuration>

我在互联网上的某处读到,在将网站上传到托管服务器之前,我必须配置我的web.config文件。在我的网站上,web.config文件默认有以下信息,



I read somewhere in internet that I must configure my web.config file before I upload website to the hosting server. In my website web.config file has following information by default,

<?xml version="1.0"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
    <connectionStrings>
  <add name="SPConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ShoppingPortal.mdf;Integrated Security=True;User Instance=True"

   providerName="System.Data.SqlClient" />
 </connectionStrings>
    <system.web>
        <trace enabled="true" localOnly="false" pageOutput="true" />
  <compilation debug="true" targetFramework="4.0"/>
    </system.web>
</configuration>



我不喜欢我不知道应该在其中编辑什么才能让它在托管服务器上工作,请帮助我在这方面我应该怎么做。提前谢谢


I don't know what should I edit in it to get it work on hosting server please help me in this regard that what should I do with this. Thank you in advance

推荐答案

问题可能 - 或可能不是 - 在您的站点配置中。首先要做的是找出问题的实际位置:这意味着要查看错误消息并完全按照它所说的去做。当你完成了 - 并且说明非常明确 - 当你再次运行你的网站时,错误将精确定位文件和它出现的行。



但是,它可能是你的连接字符串 - 任何生产服务器都不太可能使用SqlExpress,或者将SQL服务器放在与网络服务器相同的PC上,或使用集成安全性。

你需要与之交谈您的托管服务并确切地了解您需要使用哪些详细信息,我们无法告诉您,因为每个托管服务都以不同的方式配置这些内容以适合自己。
The problem may - or may not - be in your site configuration. The first thing to do is to find out where the problem actually is: which means looking at the error message and doing exactly what it says. When you have done that - and the instructions are pretty explicit - when you run your site again, the error will pinpoint the file and line it occurs on.

However, it is probably your connection string - it is unlikely that any production server will use SqlExpress, or site the SQL server on the same PC as the webserver, or use integrated security.
You will need to talk to your hosting service and find out exactly what details you need to use, we can't tell you because each hosting service configures these things differently to suit themselves.


这篇关于web.config文件变更指南的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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