- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试在 Azure 服务上发布我的 ASP.NET Core 应用程序。这有效,但是当我尝试使用应用程序功能时,我收到消息
Your App Service app is up and running.
此外,在我的 wwwroot
文件夹中,我没有任何 .html
文件。我只有一个 Index.cshtml
文件,位于我的应用程序的 Views/Home
文件夹中,所有其他文件都是 .css
、.js
等
当我在 Visual Studio 中以 Debug模式运行应用程序时,立即在浏览器中打开从 Index.cshtml
生成的页面。但应用程序在Azure中发布后,这种情况就不会发生。
如何才能让 Azure 看到 Index.cshtml
?
最佳答案
据我所知,默认路由将添加到 Startup.cs
文件的 Configure
方法中,如下所示:
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
});
我还创建了我的 .Net Core 2.0 MVC 应用程序来检查此问题,它可以在本地端和我的 azure Web 应用程序上按预期工作。
Moreover, in my wwwroot folder I don't have any .html files.
Web 应用程序和 Web 应用程序 MVC 下的 View 将编译为 {your-webapplication- assemblyname}.PrecompiledViews.dll
,您可以利用 ILSpy检查您的 DLL。
对于您的问题,我建议您通过 KUDU 清除网络应用中的网络内容,或修改发布设置并选择“文件发布选项”下的删除目标位置的其他文件,然后将应用程序重新部署到 Azure Web App 以缩小此问题的范围。
关于Azure 看不到 Index.cshtml,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50553478/
我第一次同时处理 ASP.NET、MVC 3、Web 开发。请耐心听我说,因为我知道这个主题已经从不同角度进行了大量讨论。我仍然没有找到我的具体问题的答案:为什么我的应用程序在出现 404 错误时找不
_PageStart.cshtml 与 _AppStart.cshtml 有什么区别?我可以互换使用它们吗? 最佳答案 _AppStart.cshtml 在应用程序第一次启动时执行一次。它是设置全局变
我有一个 DateTime 和 Date 的编辑器模板。 Date 的内容是 DateTime 的简单复制和粘贴。这是糟糕的复制粘贴编码。 对于用[DataType(DataType.Date)]修饰
当我在 IIS 8 中调用 .cshtml 页面时出现以下错误 “/”应用程序中的服务器错误。不提供此类页面。说明:您所请求的页面类型未被提供,因为它已被明确禁止。扩展名“.cshtml”可能不正确。
当我在 IIS 8 中调用 .cshtml 页面时出现以下错误 “/”应用程序中的服务器错误。不提供此类页面。说明:您所请求的页面类型未被提供,因为它已被明确禁止。扩展名“.cshtml”可能不正确。
每次我单击以创建 View 或部分文件时,Visual Studio 都会自动创建一个 _Layout.cshtml 和一个 _ViewStart.cshtml 文件。 我不希望我的项目创建 _Vie
我知道您可以对带有 url 的普通页面使用布局过滤器,但在出现错误时 View 会发生变化,同时保持 url 不变,因此我无法使用基于路径的新布局。任何帮助,将不胜感激。谢谢! 最佳答案 在我的脑海中
我无法在 mvc 3 razor 的 cshtml 文件中使用 RoleEnvironment.CurrentRoleInstance.Id。 RoleEnvironment 的错误表明它在当前上下文
我知道如果那是条蛇它会咬我的。但我不明白为什么它在 _Layout 头文件中有效,但在我需要它的特定索引页面中却无效。我看不到在每个使用 _Layout.cshtml 的页面中都有此代码。 这是 IF
我有一个分为多个区域的 ASP.NET MVC 4 站点。每个区域都有一个Views/Shared/_Layout.cshtml引用公共(public)共享布局的 View 。在通用布局中,我有一个侧
问题 其实有两个相关的问题: 我应该为每个页面创建一个 ViewModel 吗? 如果您在为两个页面(Create.cshtml 和 Edit.cshtml)创建单个 ViewModel 类时没有问题
在 ASP.Net 5 项目中,默认情况下我有一个名为 _ValidationScriptsPartial.cshtml 的文件:
这里有人可以帮助我吗?我有以下代码: @inherits umbraco.MacroEngines.DynamicNodeContext @{ var node = @Model.NodeBy
我希望有两个_Host.cshtml。我的想法是,我有一个具有非常不同的必需 css 和 js 的登录页面,以及一个具有不同必需的 css 和 js 的主/仪表板页面,我不想在单个 _Host 中加载
我尝试在我的 cshtml 页面中添加一个条件标签 var isTrendClicked = false; function trendChart() { $('.sparkline1'
我有一个简单的选择列表项,被插入下拉列表中。 这是 HTML 结果 Options Option1 Option2 基本上我有这个简单的 JavaScript 脚本 $(document).read
按照 MVC 中的教程,你能告诉我在 ASPX 页面中的替代方法吗 在 cshtml 页面中,VS2013 上 MVC 4 中的默认 View 类型。当我尝试上述时,显示的是字面意思。即
我想知道是否有人测试了他们基于 MVC .NET 的 Web 服务的图形用户界面部分。我用过 Watin/Specflow。我对此有两个主要顾虑: 这些测试不仅仅是图形用户界面。它们是系统检查。他们测
我正在为工作更新 Intranet 站点,需要知道如何水平对齐列表项。我知道这是通过 CSS 完成的,但我在弄清楚使它保持水平的错误所在时遇到了一些问题。 _SiteLayout.cshtml
如果特定列包含重复条目,如何清除 HTML 表格的记录?例如,如果我的表中有 2 列 - 姓名和年龄,如果 2 个人具有相同的年龄,则完全删除第二行。 function DeleteDuplicat
我是一名优秀的程序员,十分优秀!