我的项目在Visual Studio 2015中运行良好。我发布了应用程序并在IIS中上传。当我尝试运行应用程序时,我收到错误
The CodeDom provider type "Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" could not be located.
在互联网上搜索时,我发现在web配置中评论此行可以解决问题。所以我评论了这一行::
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701" />
然后我再次尝试运行我的项目,现在我收到错误:
分析器错误消息:文件'/view/global.Master'
不存在。
显示在Line 1: <%@ Page Title="" Language="C#" MasterPageFile="~/view/global.Master" AutoEventWireup="true" CodeBehind="profile.aspx.cs" Inherits="myApp.view.profile" %>
然后我将MasterPageFile的代码更改为::
<%@ Page Title="" Language="C#" MasterPageFile="../view/global.Master" AutoEventWireup="true" CodeBehind="profile.aspx.cs" Inherits="myApp.view.profile" %>
现在我收到错误::
Parser Error Message: Could not load type 'myApp.view.global'.
第1行:<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="global.master.cs" Inherits="myApp.view.global" %>
我无法理解在IIS中上传项目有什么问题。为什么我会遇到连续错误?
我粗略地解决了我的问题。以前,我将所有已发布的文件和文件夹保存在一个文件夹中,然后将该文件夹放在wwwroot目录中。所以我的文件夹结构看起来像::
wwwroot --> myapp --> bin, scripts, view folders and other files
但是现在我已将我发布的文件和文件夹直接保存在wwwroot
目录中。现在我可以浏览我的应用了。但它不是我的问题的解决方案,如果我必须托管多个应用程序怎么办?任何有关该问题的帮助将受到高度赞赏。谢谢!!!