如何打开ASP.NET Core Razor Pages应用程序的起始文件? [英] How to open the starting file of an ASP.NET Core Razor Pages app?

查看:66
本文介绍了如何打开ASP.NET Core Razor Pages应用程序的起始文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个基本问题,很抱歉道歉,但是我已经搜寻了几个小时,却找不到答案.我制作了一个ASP.NET Core Razor Pages应用程序并将其部署到一个文件夹(该文件夹在网络中,这基本上是我们的暂存环境),现在需要知道如何访问URL中的索引页.我按照此文档介绍了如何将应用程序发布到文件夹中: https://docs.microsoft.com/zh-cn/dotnet/core/deploying/deploy-with-vs?tabs=vs156 (我选择了不包含第三方的自包含部署,缔约方依赖性选项),但是现在我如何访问索引文件?

I have a basic question so apologies in advanced but I have been googling for hours and not been able to find the answer. I made an ASP.NET Core Razor Pages app and deployed it to a folder (which is in a network, it's basically our staging environment) and now need to know how to access the index page in the URL. I followed this doc on how to publish the app into a folder: https://docs.microsoft.com/en-us/dotnet/core/deploying/deploy-with-vs?tabs=vs156 (I chose the Self-contained deployment without third-party dependencies option) but now how do I access the index file?

例如,如果这是URL: https://testing.com/FolderName

For example if this is the URL: https://testing.com/FolderName

该应用程序位于"FolderName"文件夹中,接下来我需要在URL中进行后续操作以打开该应用程序吗?在FolderName文件夹内有wwwroot文件夹,appsettings.Development,appsettings,.exe,.pdb和web.config.那么,如何在网络上访问该应用程序?我还尝试了复制/粘贴文件并导航到index.cshtml,但是也没有用.

And the app is in the 'FolderName' folder what do I need to follow up next in the URL to open the app? Inside the FolderName folder there is wwwroot folder, appsettings.Development, appsettings, the .exe, a .pdb, and a web.config. So how do I access the app in the web? I also tried copy/pasting the files and navigating to index.cshtml but didn't work either.

任何帮助将不胜感激.谢谢大家.

Any help would be greatly appreciated. Thanks guys.

推荐答案

剃须刀页面并非基于文件系统(例如PHP)进行路由.

Razor Pages are not routed based on the file system (like PHP).

您启动Web服务器(通过打开 exe ),然后导航到URL,在该URL上Web服务器会告诉您它正在为该应用提供服务(在终端中,您应该看到一行听着 https://your_url:port ...).

You start the Web server (by opening the exe) and navigate to the URL where the Web server tells you it's serving the app (in the terminal you should see a line that says "Listening on https://your_url:port...").

索引应该是您在那里导航时首先看到的东西.

The index should be the first thing you see when you navigate there.

这篇关于如何打开ASP.NET Core Razor Pages应用程序的起始文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆