IIS8を実行しているWindows Server 2012で自分のサイトをホストしています。コードはVB.NETで書かれています。新しいタブでPDFを開くときのASP.NETの一般的なランタイムエラー - 停止した作業
昨日まで、私のページは、リンクボタンをクリックした後、PDFを新しいタブで表示(ダウンロードしない)するようになりました。リンクボタンは、関連付けられたファイルがデータベースに存在する場合にのみ機能します。
If (myreader(49) = "" And myreader(52).ToString() = "0") Then
lnkAttachment.Text = "N/A"
lnkAttachment.Enabled = False
Else
lnkAttachment.Text = "Click Here"
lnkAttachment.Enabled = True
ボタンをクリックすると、新しいタブでPDFが開きます。動作が停止し、一般的なランタイムエラーが表示されるようになりました。
このページへのリンクを生成するコードは次のとおりです。
:Protected Sub lnkAttachment_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkAttachment.Click
Dim wdwOpen As String = "window.open('" & "../Attachment/" & Session("ID") & ".pdf" & "','_blank');"
Response.Write("<script>")
Response.Write(wdwOpen)
Response.Write("</script>")
End Sub
私は詳細なエラー情報を示すことになってweb.configファイルとIISエラー・ページの設定を持っています
<system.web>
<customErrors mode="Off"/>
</system.web>
このIISサイトで複数のアプリケーションを設定しています。問題のあるもの(WO)は、私がPDFを開くことができない唯一のものです。このサイトでは、PDFファイルを表示するのに問題のない別のアプリケーションがあります。私はこれがIISの問題だと言いたいのですが、エラーの内容を特定できません。
私はCに行っている:\のinetpub \ログ\ LogFilesに\ W3SVC1ファイルと、この行が見つかりました:
2016-07-20 13:29:22 (server ip address) GET /WO/Attachment/40147.pdf - 443 - 192.168.0.2 Mozilla/5.0+(iPhone;+CPU+iPhone+OS+9_3_2+like+Mac+OS+X)+AppleWebKit/601.1.46+(KHTML,+like+Gecko)+Version/9.0+Mobile/13F69+Safari/601.1 - 500 0 0 31
それは500エラーを示していますが、私の人生のために私はこの問題を解決することはできませんが。私はウェブ検索で膨大な情報を見つけましたが、特定の問題を見つけることはできません。どのようにしてコードが一日働いてから、次のコードを停止し、IIS内のサイトの1つのアプリケーションに対してのみ停止します。
問題が発生する可能性がありますか?
EDIT:illinoistimコメントあたりのイベントビューアから 抜粋:
Event code: 3008
Event message: A configuration error has occurred.
Event time: 7/21/2016 6:55:26 AM
Event time (UTC): 7/21/2016 11:55:26 AM
Event ID: 949451611c784e7695ead3f75ea8d6b5
Event sequence: 125
Event occurrence: 3
Event detail code: 0
Application information:
Application domain: /LM/W3SVC/1/ROOT/WO-15-131135755702094878
Trust level: Full
Application Virtual Path: /WO
Application Path: C:\inetpub\wwwroot\OHAS\WODB\
Machine name: (Machine Name)
Process information:
Process ID: 22580
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWORK SERVICE
Exception information:
Exception type: ConfigurationErrorsException
Exception message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS. (C:\inetpub\wwwroot\OHAS\WODB\attachment\web.config line 86)
at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSection(String configKey)
at System.Web.Configuration.RuntimeConfig.GetSectionObject(String sectionName)
at System.Web.Configuration.RuntimeConfig.GetSection(String sectionName, Type type, ResultsIndex index)
at System.Web.Configuration.RuntimeConfig.get_Identity()
at System.Web.HttpContext.SetImpersonationEnabled()
at System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context)
Request information:
Request URL: (site URL)
Request path: /WO/attachment/40147.pdf
User host address: 192.168.20.1
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWORK SERVICE
Thread information:
Thread ID: 57
Thread account name: NT AUTHORITY\NETWORK SERVICE
Is impersonating: False
Stack trace: at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSection(String configKey)
at System.Web.Configuration.RuntimeConfig.GetSectionObject(String sectionName)
at System.Web.Configuration.RuntimeConfig.GetSection(String sectionName, Type type, ResultsIndex index)
at System.Web.Configuration.RuntimeConfig.get_Identity()
at System.Web.HttpContext.SetImpersonationEnabled()
at System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context)
Custom event details:
あなたのイベントビューアーをチェックしましたか?それはあなたにいくつかの詳細を与える必要があります。 – illinoistim
私はしていません。イベントビューアで私はどこを見ているべきですか? –
カスタムビューの下で、[管理イベント]を選択します。エラーを複製し、右側の更新アイコンを押してください。最近のエラーは説明とともに表示されるはずです。 – illinoistim