我正在为我的学校的一个新项目,我试图发布我的网站在ASP.Net MVC IIS 8在Windows Server 2012 R2上。'/'应用程序中的服务器错误。与视图
我的项目与Framework .net 4.5.2。
当我尝试启动我的IIS网站,我有这样的错误:
Server Error in '/' Application.
The view 'Index' or its master was not found or no view engine supports the searched locations. The following locations were searched:
~/Views/Home/Index.aspx
~/Views/Home/Index.ascx
~/Views/Shared/Index.aspx
~/Views/Shared/Index.ascx
~/Views/Home/Index.cshtml
~/Views/Home/Index.vbhtml
~/Views/Shared/Index.cshtml
~/Views/Shared/Index.vbhtml
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: The view 'Index' or its master was not found or no view engine supports the searched locations. The following locations were searched:
~/Views/Home/Index.aspx
~/Views/Home/Index.ascx
~/Views/Shared/Index.aspx
~/Views/Shared/Index.ascx
~/Views/Home/Index.cshtml
~/Views/Home/Index.vbhtml
~/Views/Shared/Index.cshtml
~/Views/Shared/Index.vbhtml
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
而且我有这个太:
Stack Trace:
[InvalidOperationException: The view 'Index' or its master was not found or no view engine supports the searched locations. The following locations were searched:
~/Views/Home/Index.aspx
~/Views/Home/Index.ascx
~/Views/Shared/Index.aspx
~/Views/Shared/Index.ascx
~/Views/Home/Index.cshtml
~/Views/Home/Index.vbhtml
~/Views/Shared/Index.cshtml
~/Views/Shared/Index.vbhtml]
System.Web.Mvc.ViewResult.FindView(ControllerContext context) +499
System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +143
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +88
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +831
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +81
System.Web.Mvc.Async.<>c__DisplayClass21.
<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +185
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +38
System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +29
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +67
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +52
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +36
System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +38
System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +43
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +67
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +38
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +607
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +134
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.2053.0
我试着用.NET框架V4.5一切4.5.2或为我的项目和我的应用程序池:
.NET v2.0 (version v2.0 and v4.0.39319 of CLR.NET)
.NET v2.0 Classic (version v2.0.50727 of CLR.NET and v4.0.39319 of CLR.NET)
.NET v4.5 (version v4.0.39319 of CLR.NET and v2.0.50727 of CLR.NET)
.NET v4.5 Classic v4.0.39319 of CLR.NET and v2.0.50727 of CLR.NET)
Classic .NET AppPool (version v4.0.39319 of CLR.NET and v2.0.50727 of CLR.NET)
DefaultAppPool (version v4.0.39319 of CLR.NET and v2.0.50727 of CLR.NET)
UPDATE: 首先,感谢您的回答。
我正在使用MVC,我已经创建了控制器,并使用该控制器默认使用视图创建。我没有改变他们的名字或任何东西。只需在其中添加一些代码即可。我的项目以及与Visual Studio 2015年社区
对于剩下的工作,我的浏览文件夹是这样的:
--> Views
--> Home
--> About.cshtml
--> Contact.cshtml
--> Legal.cshtml (not used)
--> Participants
--> Create.cshtml
--> Index.cshtml
--> Shared
--> _Layout.cshtml
--> Error.cshtml
一件事是,我已经把我的文件夹“的Inetpub - > wwwroot文件 - > MyFolder。我已经添加了IUSR和IIS_IUSRS的权限来读取和执行。我已经尝试将权限改为完全控制。
这不是我在ASP.NET MVC中添加到IIS中的第一个项目,但对于这一个我不知道什么是问题...
我希望y OU可以帮助我,因为我有一周结束前发布这个网站...
由于提前,
Mattexis
你确定有一个文件夹'Views/Home/Index。***'?它确实发布了吗?你的文件夹结构是什么样的 – Jonesopolis
当某事说“我在这里找不到文件”时,你需要去验证1)该文件实际上是否存在,以及2)试图访问该文件的帐户有权读取(并且可能执行)它。 – Will
我已经把更多的信息放在页面中,但是,我有这个文件夹和这个文件。谢谢 – Mattexis