質問するログイン新規登録

質問編集履歴

4

Web.config①、発生しているエラー① の内容を修正しました。

2021/02/03 05:07

投稿

kkkkui
kkkkui

スコア8

title CHANGED
File without changes
body CHANGED
@@ -43,36 +43,29 @@
43
43
  -->
44
44
  <configuration>
45
45
  <system.web>
46
+ <customErrors mode="Off" />
46
47
  <compilation targetFramework="4.0" />
47
48
  </system.web>
48
49
  </configuration>
49
50
  ```
50
51
  ### 発生しているエラー①
51
52
  ```
52
- Server Error in '/' Application.
53
+ '/' アプリケーションでサーバー エラーが発生しました。
53
54
 
54
- Runtime Error
55
- 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.
55
+ パーサー エラー
56
+ 説明: この要求の処理に必要なリソースの解析中にエラーが発生しました。以下の解析エラーの詳細を確認し、ソース ファイルに変更を加えてください。
56
57
 
57
- 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".
58
+ パーサー エラー メッセージ: 'test.test' を読み込めませんでした。
58
59
 
59
- <!-- Web.Config Configuration File -->
60
+ ソース エラー:
60
61
 
62
+ 行 1: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test.aspx.cs" Inherits="test.test" %>
63
+ 行 2:
61
- <configuration>
64
+ 行 3: <!DOCTYPE html>
62
- <system.web>
63
- <customErrors mode="Off"/>
64
- </system.web>
65
- </configuration>
66
65
 
67
- 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.
66
+ ソース ファイル: /test/test.aspx 行: 1
68
67
 
69
- <!-- Web.Config Configuration File -->
70
-
71
- <configuration>
72
- <system.web>
73
- <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
68
+ バージョン情報: Microsoft .NET Framework バージョン:4.0.30319; ASP.NET バージョン:4.8.4250.0
74
- </system.web>
75
- </configuration>
76
69
  ```
77
70
  ### ソースコード(Web.config②)
78
71
  ```

3

一部情報の誤りを訂正

2021/02/03 05:07

投稿

kkkkui
kkkkui

スコア8

title CHANGED
File without changes
body CHANGED
@@ -8,7 +8,7 @@
8
8
  もう1つはDBサーバ役としてSQLServer(Docker)とし
9
9
  ホストからIEでC#.netで作成したサイトを参照したいです。
10
10
 
11
- 今詰まっているのは、IISを立ち上げると
11
+ 今詰まっているのは、Docker(IIS)を立ち上げると
12
12
  簡単なsample.htmlやsample.aspxはIE上から参照できるようになったのですが、
13
13
  VisualStudioでビルドしたtestプロジェクトを参照しようとすると
14
14
  IEの画面にエラーが表示されます。
@@ -21,7 +21,7 @@
21
21
 
22
22
  Web.config①~③で動作させたときのエラー①~③が以下です。
23
23
  Web.config①…VisualStudioで単純にビルド
24
- Web.config②…本番環境で動いているWeb.configからDB設定などを除去したもの(このweb.configで本番環境だとtest.aspxは動作しました)
24
+ Web.config②…本番環境で動いているWeb.configからDB設定などを除去したもの
25
25
  Web.config③…エラー②の指摘箇所を除去したもの
26
26
 
27
27
  ### IISDockerのファイル構成

2

ソースの記載方法を修正しました

2021/02/03 02:21

投稿

kkkkui
kkkkui

スコア8

title CHANGED
File without changes
body CHANGED
@@ -174,6 +174,7 @@
174
174
  https://www.kinakomotitti.net/entry/2018/02/06/084222
175
175
 
176
176
  ### ソースコード(test.aspx)
177
+ ```
177
178
  <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test.aspx.cs" Inherits="test.test" %>
178
179
  <!DOCTYPE html>
179
180
  <html xmlns="http://www.w3.org/1999/xhtml">
@@ -188,4 +189,5 @@
188
189
  </div>
189
190
  </form>
190
191
  </body>
191
- </html>
192
+ </html>
193
+ ```

1

ソースの記載方法を修正しました

2021/02/03 02:02

投稿

kkkkui
kkkkui

スコア8

title CHANGED
File without changes
body CHANGED
@@ -35,6 +35,7 @@
35
35
  □□□□┗Web.config
36
36
 
37
37
  ### ソースコード(Web.config①)
38
+ ```
38
39
  <?xml version="1.0" encoding="utf-8"?>
39
40
  <!--
40
41
  ASP.NET アプリケーションの構成方法の詳細については、
@@ -45,8 +46,9 @@
45
46
  <compilation targetFramework="4.0" />
46
47
  </system.web>
47
48
  </configuration>
48
-
49
+ ```
49
50
  ### 発生しているエラー①
51
+ ```
50
52
  Server Error in '/' Application.
51
53
 
52
54
  Runtime Error
@@ -71,8 +73,9 @@
71
73
  <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
72
74
  </system.web>
73
75
  </configuration>
74
-
76
+ ```
75
77
  ### ソースコード(Web.config②)
78
+ ```
76
79
  <?xml version="1.0" encoding="utf-8"?>
77
80
  <configuration>
78
81
  <system.web>
@@ -95,8 +98,9 @@
95
98
  <modules runAllManagedModulesForAllRequests="true" />
96
99
  </system.webServer>
97
100
  </configuration>
98
-
101
+ ```
99
102
  ### 発生しているエラー②
103
+ ```
100
104
  '/' アプリケーションでサーバー エラーが発生しました。
101
105
 
102
106
  構成にエラーがあります。
@@ -116,8 +120,9 @@
116
120
  ソース ファイル: C:\inetpub\wwwroot\test\web.config    行: 10
117
121
 
118
122
  バージョン情報: Microsoft .NET Framework バージョン:4.0.30319; ASP.NET バージョン:4.8.4250.0
119
-
123
+ ```
120
124
  ### ソースコード(Web.config③)
125
+ ```
121
126
  <?xml version="1.0" encoding="utf-8"?>
122
127
  <configuration>
123
128
  <system.web>
@@ -139,8 +144,9 @@
139
144
  <modules runAllManagedModulesForAllRequests="true" />
140
145
  </system.webServer>
141
146
  </configuration>
142
-
147
+ ```
143
148
  ### 発生しているエラー③
149
+ ```
144
150
  '/' アプリケーションでサーバー エラーが発生しました。
145
151
 
146
152
  アクセスが拒否されました。
@@ -150,7 +156,7 @@
150
156
  エラー メッセージ 401.2: 許可されていません: サーバー構成によりログオンに失敗しました。指定された資格情報に基づいてこのディレクトリまたはページを表示するためのアクセス許可があること、および認証方法が Web サーバーで有効になっていることを確認してください。詳細については、Web サーバーの管理者に問い合わせてください。
151
157
 
152
158
  バージョン情報: Microsoft .NET Framework バージョン:4.0.30319; ASP.NET バージョン:4.8.4250.0
153
-
159
+ ```
154
160
  ### 試したこと
155
161
  ホストのIISでも同じ現象が出るか試すと
156
162
  エラー①は異なりましたが、エラー②③は同現象でした。