実現したいこと
該当サイトが表示されるようにしたい。
前提
クライアントのPC上でVisual Studio 2022を使用して、簡単なASP.NETによるWebアプリケーションを作成しPC上で動作確認後、サーバー(Windows Server 2019)へ発行した。
発行の方法は、サーバー側のIISマネージャーで公開サイトの追加を行い(ポートは82)、
作成された発行設定フィルを、PC側のVisual Studioにインポートし「発行」をクリックして発行した。
WebDeploy(8172)と82のポートは、「セキュリティが強化されたWindowsファイアウォール」で受信の規則を作成して解放した。
「Web Appは正常に公開されまたした。」のメッセージの後ブラウザが起動してサイトを開こうとしたところで、エラーメッセージが出で該当サイトが開かない。
発生している問題・エラーメッセージ
ブラウザのエラーメッセージ:
403 - Forbidden: Access is denied.
You do not have permission to view this directory or page using the credentials that you supplied.
サーバーのIISマネージャーのWebサイトの参照でブラウザに表示されたフォーム名(WebForm1)をクリックした時のエラーメッセージ:
'/' アプリケーションでサーバー エラーが発生しました。
アクセスが拒否されました。
説明: 現在の Web 要求を実行中に、ハンドルされていない例外が発生しました。エラーに関する詳細および例外の発生場所については、スタック トレースを参照してください。
例外の詳細: System.ComponentModel.Win32Exception: アクセスが拒否されました。
ソース エラー:
現在の Web 要求の実行中にハンドルされていない例外が生成されました。障害の原因および発生場所に関する情報については、下の例外スタック トレースを使って確認できます。
スタック トレース:
[Win32Exception (0x80004005): アクセスが拒否されました。]
[ExternalException (0x80004005): プログラムを実行できません。実行しようとしたコマンドは "D:\個人ホルダー\XXX\YYYY\ogiso\HelloWebDeploy\bin\roslyn\vbc.exe" /shared /keepalive:"10" /noconfig @"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\e3c55a22\ffcfd397\53ayy3no.cmdline" です。]
System.CodeDom.Compiler.Executor.ExecWaitWithCaptureUnimpersonated(SafeUserTokenHandle userToken, String cmd, String currentDir, TempFileCollection tempFiles, String& outputName, String& errorName, String trueCmdLine) +1767
System.CodeDom.Compiler.Executor.ExecWaitWithCapture(SafeUserTokenHandle userToken, String cmd, String currentDir, TempFileCollection tempFiles, String& outputName, String& errorName, String trueCmdLine) +208
System.CodeDom.Compiler.Executor.ExecWaitWithCapture(IntPtr userToken, String cmd, String currentDir, TempFileCollection tempFiles, String& outputName, String& errorName) +125
Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler.Compile(CompilerParameters options, String compilerFullPath, String arguments, String& outputFile, Int32& nativeReturnValue) +393
Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler.FromFileBatch(CompilerParameters options, String[] fileNames) +857
Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler.CompileAssemblyFromFileBatch(CompilerParameters options, String[] fileNames) +185
System.Web.Compilation.AssemblyBuilder.Compile() +1869
System.Web.Compilation.BuildProvidersCompiler.PerformBuild() +306
System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) +491
System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) +337
System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) +142
System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound) +161
System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp) +47
System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +44
System.Web.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +375
System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +195
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +128
バージョン情報: Microsoft .NET Framework バージョン:4.0.30319; ASP.NET バージョン:4.7.4069.0
該当のソースコード
言語: Visual Basic
Public Class WebForm1
Inherits System.Web.UI.Page
Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Label2.Text = TextBox1.Text & "さん、Webサイトへようこそ" End Sub
End Class
試したこと
サーバー側のIISの機能ビューでディレクトリの参照機能を有効にした。
(エラーの状態は変わらず)
補足情報(FW/ツールのバージョンなど)
PC側:
Windows 10, Visual Studio 2022(.NetFramework4.7.2を指定)
サーバー側:
Windows Server 2019 , .NET Framework4.7 , ASP.NET4.7 , WebDeploy3.6 , IIS 10.0

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2023/11/06 05:23