2016-05-07 4 views
0

.netframework 4.5.2でVisual Studio 2015を使用してウェブサイトを作成しました。ウェブサイトはローカルマシンで正常に動作していますが、私がGodaddyにウェブサイトを公開してアップロードしたときです。最初にエラーカスタムを取得する必要があります。オフにする必要があります。これを修正するタグを追加しました。GothadyでホストされているAps.net MVC5ウェブサイト

<customErrors mode="Off"/> 

それから私はトラスト許可エラー「System.Security.SecurityException取得:タイプの許可の要求「System.Security.Permissions.SecurityPermission、mscorlib、バージョン= 4.0.0.0、文化=中立、なPublicKeyTokenを= b77a5c561934e089が失敗しました。 私はグーグルで、信頼レベルがweb.configとasp.netの設定で完全にサーバーに設定されている必要があることを知りました。 私はGodaddyサーバーでCASの信頼レベルをfullに設定しましたが、web.configが設定されていても動作しませんでした。

<trustLevel name="Full" policyFile="internal"/> 

内部サーバーエラーが発生しています。 私はもう一度やってみましたが、同じエラーです。

<securityPolicy> 
    <trustLevel name="Full" policyFile="internal"/> 
</securityPolicy> 

私はweb.configファイルで何が必要なのかわかりません。私のweb.configを見つけてください

<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=SAFIRE\SQLEXPRESS;Initial Catalog=Hotel;Integrated Security=True" providerName="System.Data.SqlClient" /> 
</connectionStrings> 
<appSettings> 
    <add key="webpages:Version" value="3.0.0.0" /> 
    <add key="webpages:Enabled" value="false" /> 
    <add key="ClientValidationEnabled" value="true" /> 
    <add key="UnobtrusiveJavaScriptEnabled" value="true" /> 
    <add key="MvcMailer.BaseURL" value="" /> 
</appSettings> 
<system.web>  
<authentication mode="None" />  
<customErrors mode="Off"/> 
<compilation debug="true" targetFramework="4.5.2" /> 
    <httpRuntime targetFramework="4.5.2" /> 
    <trustLevel name="Full" policyFile="internal" /> 
</system.web> 
<system.webServer> 
    <modules> 
     <remove name="FormsAuthentication" /> 
    </modules> 
</system.webServer> 
<runtime> 
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> 
    <dependentAssembly> 
    <assemblyIdentity name="Microsoft.Owin.Security" 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" 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" publicKeyToken="31bf3856ad364e35" /> 
    <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" /> 
    </dependentAssembly> 
    <dependentAssembly> 
    <assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" /> 
    <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" /> 
    </dependentAssembly> 
    <dependentAssembly> 
    <assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" /> 
    <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> 
    </dependentAssembly> 
    <dependentAssembly> 
    <assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" /> 
    <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0" /> 
    </dependentAssembly> 
    <dependentAssembly> 
    <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" /> 
    <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" /> 
    </dependentAssembly> 
    <dependentAssembly> 
    <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" /> 
    <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" /> 
    </dependentAssembly> 
    <dependentAssembly> 
    <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" /> 
    <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" /> 
    </dependentAssembly> 
    <dependentAssembly> 
    <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" /> 
    <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" /> 
    </dependentAssembly> 
    <dependentAssembly> 
    <assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" /> 
    <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" /> 
    </dependentAssembly> 
    <dependentAssembly> 
    <assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f" culture="neutral" /> 
    <bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2" /> 
    </dependentAssembly> 
</assemblyBinding> 
</runtime> 
<entityFramework> 
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" /> 
    <providers> 
     <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /> 
    </providers> 
</entityFramework> 
<system.net> 
    <mailSettings> 
     <smtp from="xxx"> 
     <network host="smtpout.europe.secureserver.net" port="25" userName="xxx" password="xxx" /> 
     </smtp> 
    </mailSettings> 
</system.net> 
<system.codedom> 
    <compilers> 
     <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.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.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+" /> 
    </compilers> 
</system.codedom> 

web.configの設定がありません。

答えて

-1

あなたは問題

1を識別するために、物事のカップルを行う必要があります)、接続文字列は、「真の統合セキュリティ=」、trueの場合、それは、Windowsの資格情報を使用してデータベースに接続しようとウェブサイトを意味が含まれているかどうかをチェックし、してみてくださいこれで問題が解決しない場合は、その後一時的にカスタムエラーをオンにして、ウェブサイトを閲覧し、それはいくつかの意味のあるエラーメッセージ

+0

を与える必要があります。これはコメントではなく、答えはWindows資格情報

2)を使用しません。問題が解決したら、回答を投稿することができます。問題が明確でない場合は、説明を求めるコメントを投稿してください。 – CodeCaster

+0

接続文字列をGodaddyデータベースからの接続文字列に変更し、カスタムエラーを有効にしました。それでも同じエラーが表示されます。 500内部サーバーエラー。 –

+0

we.configをに更新しました。今、私は403禁じられたエラーを取得しています。あなたはこの文書にアクセスする許可を持っていません。私はこれが信用レベルの問題で、信用レベルをいっぱいにしてどこが間違っているのかわからないと思います。 –

関連する問題