简体   繁体   English

如何在IIS中本地托管的应用程序的URL中添加自定义目录?

[英]How to add custom directory in URL for app hosted locally on IIS?

I have the following situation for testing purposes my app is hosted on IIS on my machine and when I direct the physical path to the solution folder not the direct folder of the project when I try to access the .aspx file of the site I get the following error: 我出于测试目的而遇到以下情况,我的应用程序托管在计算机上的IIS上,当我尝试访问站点的.aspx文件时,将物理路径定向到解决方案文件夹而不是项目的直接文件夹时,以下错误:

在此处输入图片说明

The URL (it uses https protocol) is as it should be: URL(使用https协议)应为:

localhost:159/ SalesforceV5RapidSearch /RapidSearch.aspx? 本地主机:159 / SalesforceV5RapidSearch /RapidSearch.aspx?

The bolded folder must be there because on the staging server the URL is generated automatically and I have to make it work locally with this url. 粗体文件夹必须位于该文件夹中,因为在登台服务器上,URL是自动生成的,而我必须使它与此本地URL一起使用。 To the core of the problem when I direct the physical path to the project folder everything works and the Urls is localhost:159/RapidSearch.aspx? 问题的核心是,当我将物理路径指向项目文件夹时,一切正常,并且localhost:159/RapidSearch.aspx?localhost:159/RapidSearch.aspx? the thing is I need that path to be the same as the above URL. 问题是我需要该路径与上述URL相同。

The given error is because the <authentication> element can be set only in the global web.config not in any of the subfolders and when I direct the path to the directory of the solution the web.config used is in a subfolder. 给定的错误是因为<authentication>元素只能在全局web.config设置,而不能在任何子文件夹中设置,并且当我将路径定向到解决方案的目录时,使用的web.config位于子文件夹中。 Even if I put the project in two folders to make the URL the same it returns the same error because the web.config is again in a subfolder and the IIS does not recognize it as global. 即使我将项目放在两个文件夹中以使URL相同,它也会返回相同的错误,因为web.config再次位于子文件夹中,并且IIS无法将其识别为全局文件夹。

确保您已安装IIS服务器的所有必需的身份验证功能,并且已在IIS中实际发布了该网站。

我找到了一种解决方案,该解决方案是将Web应用程序添加到IIS中的托管网站,该应用程序以这种方式通向目录,因此URL应为localhost:159 / SalesforceV5RapidSearch / RapidSearch.aspx?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何从Azure Web应用程序与IIS本地托管的WCF服务进行通信? - How to communicate from Azure web app to WCF services hosted locally in IIS? 如何在IIS托管的应用程序中定期执行某些操作? - How to do something periodically in an IIS hosted app? 当应用程序可以自托管或IIS时如何将NTLM身份验证添加到.net核心 - How to add NTLM auth to .net core when app could be self hosted or IIS 使用 IIS 托管服务时出现问题 - 本地和远程 - Problem consuming IIS hosted service - locally and remotely 参数值不一致-Azure API App Client调用本地IIS托管API - Unconsistent values of parameter - Azure API App Client calls locally IIS Hosted API 如何在 IIS 托管的网站中接收自定义 webhook? - How do I receive a custom webhook in an IIS hosted website? 如何在IIS中托管nettcpbinding的Visual Studio中添加服务引用? - How to add service reference in visual studio with nettcpbinding hosted in IIS? 如何从IIS中托管的ASP应用程序执行Azure Powershell cmdlet - How Execute Azure Powershell cmdlets from a ASP app hosted in IIS 如何在IIS托管的WCF应用程序上执行一些初始启动代码? - How to execute some initial startup code on a IIS hosted WCF app? IIS中托管时目录中的文件未列出 - Files in directory not listing when hosted in IIS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM