使用ASP.NET网站进行Daddy Economy Windows Hosting Issue

时间:2018-05-24 22:03:09

标签: asp.net web-config windows-hosting

Go Daddy告诉我我的网站无法正常工作的原因是由于web.config文件但是没有,不能,或者不会告诉我原因究竟是什么。我认为任何使用plesk的主机都是一样的。我没有添加或更改vs生成的web.config文件。任何人都知道要使用plesk托管的网站需要更改哪些内容?

<?xml version="1.0" encoding="utf-8"?>
<!--
  For more information on how to configure your ASP.NET application, please 
visit
  https://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <configSections>
    <!-- For more information on Entity Framework configuration, visit 
http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework"
      type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, 
EntityFramework, Version=6.0.0.0, Culture=neutral, 
PublicKeyToken=b77a5c561934e089"
      requirePermission="false"/>
 </configSections>
  <connectionStrings>
    <add name="DefaultConnection"
      connectionString="Data Source=(LocalDb)\MSSQLLocalDB;Initial 
 Catalog=aspnet-WebSite3-dc1d217f-11d8-4c59-a3eb- 
 70b83e3aa30f;AttachDbFilename=|DataDirectory|\aspnet-WebSite3-dc1d217f- 
11d8- 
4c59-a3eb-70b83e3aa30f.mdf;Integrated Security=SSPI"
      providerName="System.Data.SqlClient"/>
  </connectionStrings>
  <system.web>
    <authentication mode="None"/>
    <compilation debug="true" targetFramework="4.6.2"/>
    <httpRuntime targetFramework="4.6.2"/>
   <pages>
      <namespaces>
    <add namespace="System.Web.Optimization"/>
    <add namespace="Microsoft.AspNet.Identity"/>
  </namespaces>
  <controls>
    <add assembly="Microsoft.AspNet.Web.Optimization.WebForms" 
namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt"/>
      </controls>
    </pages>
    <membership>
      <providers>
        <!--
      ASP.NET Membership is disabled in this template. Please visit the following link https://go.microsoft.com/fwlink/?LinkId=301889 to learn about the ASP.NET Membership support in this template
    -->
    <clear/>
  </providers>
</membership>
<profile>
  <providers>
    <!--
      ASP.NET Membership Profile is disabled in this template. Please visit the following link https://go.microsoft.com/fwlink/?LinkId=301889 to learn about the ASP.NET Membership support in this template
    -->
    <clear/>
  </providers>
</profile>
<roleManager>
  <!--
        ASP.NET Membership Role is disabled in this template. Please visit the following link https://go.microsoft.com/fwlink/?LinkId=301889 to learn about the ASP.NET Membership support in this template
    -->
  <providers>
    <clear/>
  </providers>
</roleManager>
<!--
        If you are deploying to a cloud environment that has multiple web server instances,
        you should change session state mode from "InProc" to "Custom". In addition,
        change the connection string named "DefaultConnection" to connect to an instance
        of SQL Server (including SQL Azure and SQL  Compact) instead of to SQL Server Express.
  -->
<sessionState mode="InProc" customProvider="DefaultSessionProvider">
  <providers>
    <add name="DefaultSessionProvider"
      type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
      connectionStringName="DefaultConnection"/>
  </providers>
</sessionState>
  </system.web>
  <system.webServer>
    <modules>
      <remove name="FormsAuthentication"/>
</modules>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <dependentAssembly>
    <assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed"/>
    <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0"/>
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="WebGrease" culture="neutral" publicKeyToken="31bf3856ad364e35"/>
    <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234"/>
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089"/>
    <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0"/>
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="Microsoft.Owin" culture="neutral" publicKeyToken="31bf3856ad364e35"/>
    <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0"/>
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="Microsoft.Owin.Security.OAuth" culture="neutral" publicKeyToken="31bf3856ad364e35"/>
    <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0"/>
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="Microsoft.Owin.Security.Cookies" culture="neutral" publicKeyToken="31bf3856ad364e35"/>
    <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0"/>
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="Microsoft.Owin.Security" culture="neutral" publicKeyToken="31bf3856ad364e35"/>
    <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0"/>
  </dependentAssembly>
  </assemblyBinding>
</runtime>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, 
EntityFramework">
  <parameters>
    <parameter value="mssqllocaldb"/>
  </parameters>
</defaultConnectionFactory>
<providers>
  <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer"/>
</providers>
</entityFramework>
<system.codedom>
<compilers>
  <compiler language="c#;cs;csharp" extension=".cs"

type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701"/>
  <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb"
    type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+"/>
</compilers>
</system.codedom>
</configuration>

我之前不得不为Go Daddy部署一个网站,所以我希望有人可以对这个问题有所了解。

我没有收到尝试浏览网站的错误消息,只是在抛出异常时发生的通用消息,并且无法显示错误:

'/'应用程序中的服务器错误。 运行时错误 说明:服务器上发生应用程序错误。此应用程序的当前自定义错误设置可防止远程查看应用程序错误的详细信息(出于安全原因)。但是,它可以由运行在本地服务器计算机上的浏览器查看。

详细信息:要在远程计算机上查看此特定错误消息的详细信息,请在位于当前Web应用程序根目录中的“web.config”配置文件中创建标记。然后,此标记应将其“mode”属性设置为“Off”。

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

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

注意:您看到的当前错误页面可以通过修改应用程序配置标记的“defaultRedirect”属性以指向自定义错误页面URL来替换为自定义错误页面。

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

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

2 个答案:

答案 0 :(得分:0)

您需要更改Web应用程序的信任级别。

Click here to know more.

答案 1 :(得分:0)

事实证明它比值得更痛苦,抛出一个临时的html网站,并正在努力将托管转移到AWS。