在共享主机托管ASP.NET项目 - 分析器错误信息:未能加载类型'WebApplication1._Default“ [英] Hosting an ASP.NET Project on Shared Hosting - Parser Error Message: Could not load type 'WebApplication1._Default'

查看:1804
本文介绍了在共享主机托管ASP.NET项目 - 分析器错误信息:未能加载类型'WebApplication1._Default“的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想4.0 web表单项目部署一个简单的Hello World asp.net来共享主机我的godaddy4克窗户和我不断收到错误消息分析器错误信息:未能加载类型'WebApplication1._Default'这个ASP。网项目运行良好本地通过Visual Studio 2010在我的电脑。

I am trying to deploy a simple hello world asp.net 4.0 webforms project to my godaddy 4g windows shared hosting and I keep getting the error message "Parser Error Message: Could not load type 'WebApplication1._Default'. This asp.net project runs fine locally through Visual Studio 2010 on my pc.

我的GoDaddy的共享主机具有II7,并设置为集成管道模式。我可以运行一个asp.net web表单的网站没有问题,但是当我尝试部署一个asp.net的项目,我每次收到此错误信息。我与GoDaddy支持说话,他们说一切都设置正确与我共同主办,这是我的web.config的一个问题。这里是我的code:

My GoDaddy Shared Hosting has II7 and it is set to integrated pipeline mode. I can run an asp.net webforms website with no issues but when I attempt to deploy an asp.net project I get this error message everytime. I spoke with godaddy support and they said everything is setup correctly with my shared hosting and this is a problem with my web.config. Here is my code:

Default.aspx的

Default.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <p>test</p>
    </div>
    </form>
</body>
</html>

Default.aspx.cs

Default.aspx.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication1
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
    }
}

Web.config文件

Web.config

<configuration>
    <system.web>
        <customErrors mode="Off"/>
    </system.web>
</configuration>

我使用Visual Studio 2010的发布功能我的文件ftp到我的共享主机。是那些获得发布到我的共享主机目录中的文件是:

I am using the publishing feature of Visual Studio 2010 to ftp my files to my shared hosting. The files that get published to my shared hosting directory are:


  • bin文件夹 - 其中包括
    WebApplication1.dll和
    WebApplication1.pdb文件

  • 的Default.aspx

  • 的Web.config

什么我需要添加到我的web.config文件,以获得该项目运行?

What do I need to add to my web.config file to get this project to run?

推荐答案

我之所以得到这个解析错误,是因为我忘了在IIS中创建一个虚拟目录包含我的ASP.Net项目的文件夹。在添加IIS虚拟目录和标记设置应用程序根目录现在我的设置项目后成功运行。

The reason I was getting this parsing error was because I forgot to create a virtual directory in IIS for the folder containing my ASP.Net Project. After adding the Virtual Directory in IIS and marking the "Set Application Root" setting my project now runs successfully.

这篇关于在共享主机托管ASP.NET项目 - 分析器错误信息:未能加载类型'WebApplication1._Default“的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆