English 中文(简体)
ASP.NET C# - 资料来源:File Parse Error, 不能装上类型的档案
原标题:ASP.NET C# - Source File Parse Error - Could not load inherits type file
  • 时间:2011-03-10 19:19:09
  •  标签:
  • c#
  • asp.net

我如何纠正这一错误?

I m running .NET Framework v4.0.30319 so the Framework shouldn t be an issue. I m not using any DLL files or bin directories. How do I setup the IIS/Virtual Directory if I m using Forms Authentication for the whole website using VS2010?

说明: 在分配满足这一请求所需的资源时出现了错误。 请审查以下具体的细微错误细节,并适当修改你的来源档案。

Parser Error Message: Could not load type 
     ACAWebApplication.Pages.State_Carrier_Search .
Source Error:

Line 1:  <%@ Page Title="ACA Web App - State Carrier Search" Language="C#"
             MasterPageFile="~/Pages/User.Master" AutoEventWireup="true"
             CodeBehind="State_Carrier_Search.aspx.cs"
             Inherits="ACAWebApplication.Pages.State_Carrier_Search" %>
Line 2:  <asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" 
             runat="server">
Line 3:      <style type="text/css">
Source File: /Pages/State_Carrier_Search.aspx    Line: 1

The Codebehind for State_Carrier_Search.aspx.cs file:

namespace ACAWebApplication.Pages
{
    public partial class State_Carrier_Search : System.Web.UI.Page
    {
        protected void Page_LoadS(object sender, EventArgs e)

The Code for State_Carrier_Search.aspx file is as follows:

<%@ Page Title="ACA Web App - State Carrier Search" Language="C#" MasterPageFile="~/Pages/User.Master" AutoEventWireup="true" CodeBehind="State_Carrier_Search.aspx.cs" Inherits="ACAWebApplication.Pages.State_Carrier_Search" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">

感谢!

最佳回答

Thou 不是名称类别和名称空间

THIS是你的问题

namespace ACAWebApplication.Pages
{
    public partial class ACAWebApplication.Pages.State_Carrier_Search : System.Web.UI.Page
    {

The parser sees a ACAWebApplication. PAges namespace and sees ACAWebApplication. 页: 1 这可能是合法的,但这是非常错误的。

Drop the ACAWebApplication. 班次名称,应当工作。 它是自动产生的,还是你从地名中抽取了名称。 改变

and read Eric lippert musings on it - whole series quite enlightening

问题回答

互联网版本是否正确放入该系统? 这可能是1.NET2.0,试图在1.0框架内运行。

请参看。 具体列出申请集合框架版本(IIS 7),以更多地了解如何为申请集合规定一个网络框架版本。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签