问题
I'm developing some Asp.Net website and I'm trying to run it on my IIS, I published the web (under build option) and put it under wwwroot, but I get this parser error below. shall I publish the web to add it in inetmgr? or just put the files in my project folder there? what's the point of publishing?
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
and this is the line which cause it.
Line 1: <%@ page language="C#" autoeventwireup="true" inherits="App_Pages_Default, App_Web_av5ghx1x" %>
回答1:
Try changing your publish settings. When you publish the website, uncheck
Allow this precompiled site to be updateable
That should take care of the extra the App_Web_av5ghx1x.
回答2:
I don't know what it's purpose is, but I would try removing App_Web_av5ghx1x
from Inherits, and add the CodeBehind
attribute:
<%@ page Language="C#" Autoeventwireup="true" CodeBehind="App_Pages_Default.aspx.cs" Inherits="App_Pages_Default" %>
来源:https://stackoverflow.com/questions/7810102/getting-parser-error-for-asp-net-by-iis