简体   繁体   English

“文件.master不存在”

[英]“The file .master does not exist”

I have a website which uses .net framework 4.5. 我有一个使用.net framework 4.5的网站。 Using Visual Studio 2013, I have no issues to run it. 使用Visual Studio 2013,运行它没有任何问题。 However, when I publish it, I get the following error message: "the file '/Views/Shared/Admin.Master' doesn't exists.", but it does exists. 但是,当我发布它时,我收到以下错误消息:“文件'/Views/Shared/Admin.Master'不存在。”,但确实存在。

Linha 1:  <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Admin.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
Linha 2:  
Linha 3:  <asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">

Any idea about it, if I need to do something before publishing, or if I need to configure something in IIS? 任何想法,如果我需要在发布之前做一些事情,或者我需要在IIS中配置一些东西? Thanks a lot. 非常感谢。

I faced the same issue, the application build and run correctly on visual studio 2013, but give that error when publishing. 我遇到了同样的问题,应用程序在visual studio 2013上构建并正确运行,但在发布时会出现错误。

To fix that I changed the build action of the master-page from None to Content 为了解决这个问题,我将主页的构建操作从None更改为Content

Probably IIS issue. 可能是IIS问题。 Go to your IIS, go to your website. 转到您的IIS,转到您的网站。 Once there, in the IIS tab, find Authentication. 在那里,在IIS选项卡中,找到身份验证。 Open it. 打开它。 Enable ASP.NET Impersonation. 启用ASP.NET模拟。

It happens to me sometimes. 有时它发生在我身上。 Is a problem of rights 是权利问题

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM