ASP.net C # - Failed to load type

On my page, I have:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="siteSettings.aspx.cs" Inherits="APack.admin.siteSettings" %>

<!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>

    </div>
    </form>
</body>
</html>

My code is:

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

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

        }
    }
}

It throws an exception:

Parser Error Message: Could not load type 'APack.admin.siteSettings'.

This was done only in Visual Studio, right click -> new file. It just doesn't work :( Any ideas?

+3
source share
3 answers

Have you created the app?

+10
source

I think I found one of the possible solutions, click "project name". "Properties", then name "root namespace" in the name of the web application, for example, "YourNamespace", and then recompile the dll

+1
source

: # Visual Studio 2010 - " "


:

<%@ Assembly Name="YOURASSEMBLY.NAME, Version=1.0.0.0, Culture=neutral, PublicKeyToken=YOURPUBLICKEYTOKEN" %>
0

Source: https://habr.com/ru/post/1758882/


All Articles