2013-11-03 4 views
1

안녕 전문가 어떻게 지내세요? 저는 학생이고 SQL Server 2005를 사용하여 asp.net C# Visual Studio 2010을 학습합니다. 데이터베이스가있는 웹 사이트를 개발했습니다. 나는 인터넷에서 도움을받는 자율 학습으로이 웹 사이트를 개발했다. 웹 사이트가 완성되어 내 컴퓨터에서 완벽하게 작동합니다.web.config 파일 교환 가이드

이미 호스팅 서버와 도메인 이름을 등록했습니다. 나는 내 web.config 파일을 구성해야합니다 인터넷 어딘가에 읽어

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 파일에서 기본적으로 정보를, 나는 그것이 서버 내가 무엇을해야한다고이 점에서 저를 도와주세요 호스팅 작업을 얻기 위해 내가 편집해야하는지 모르는

<?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> 

을 다음있다 이. 사전에 감사합니다

+2

오류 메시지가 실제로 무엇을해야하는지 알려주고 있습니다 ... ''섹션에''태그를 추가하십시오. – Dan

+0

당신이 나를 위해 일한 감사하지만 지금은 몇 가지 다른 오류 내가 그들을 고쳤지 만 그들 중 하나는, 내가 다시는 그 오류가 강타 오전 표시됩니다 : 인식 할 수없는 특성 'targetFramework'. 속성 이름은 대소 문자를 구분합니다. 줄 13 : Student

+0

[StackOverflow : 인식 할 수없는 특성 'targetFramework'. 속성 이름은 대소 문자를 구분합니다.] (http://stackoverflow.com/questions/7530725/unrecognized-attribute-targetframework-note-that-attribute-names-are-case-sen) – Dan

답변

2

오류는 "오류가 발생했습니다"라는 basicall이라는 일반 오류입니다. 오류가 무엇인지 알아 내기 위해 ASP.NET은 web.config 파일의 <system.web> 섹션에 구성 설정을 추가 할 것을 요구합니다.

기본적으로 <customerErrors>modeRemoteOnly으로 설정됩니다. 사이트를 로컬에서 (localhost를 사용하여) 탐색 한 경우에만 전체 오류를 볼 수 있다는 의미입니다.

그래서, 오류가 <system.web> 섹션에서의 Web.config이 추가되고 있는지 확인하려면 :

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

이 당신에게 실제 오류 메시지를 공개하고 다음 문제를 해결할 수 있습니다 (또는 포스트 다른 질문 :)).

일단 오류를 수정하면이 설정을 On으로 설정하십시오. 그렇지 않으면 원격 사용자에게 전체 스택 추적 오류를 표시하게됩니다.

설명서는 here입니다.

+0

감사합니다. 하지만 지금은 그 날 몇 가지 다른 오류를 보여 주지만 그들 중 하나는, 내가 다시는 그 오류가 맞았다 : 인식 할 수없는 특성 'targetFramework'입니다. 속성 이름은 대소 문자를 구분합니다. 행 13 : Student

+1

@Student - 그것을'targetframework'로 변경하십시오 - 설정 파일에서 낙타의 경우를 사용하지 마십시오. 또한 참고 ** 이것은 정확하게 메시지가 ** – Hogan

+0

라고 말한 것입니다.하지만 선생님은 targetframework에 대해 말한대로 편집 할 때 속성이 허용되지 않는다고 말합니다. – Student