How to fix the "Type or namespace error" error?

I am concerned that the web hosting that I pay for is not configured correctly. ASP.NET websites that compile and run correctly on my local computer do not work after they are deployed.

The problem I am facing is a compilation error: CS0246, "Type or namespace could not be found (did you specify the" using "link or assembly link?)

My website contains the following files and folders:

websitedemo/Default.aspx
websitedemo/Default.aspx.cs
websitedemo/App_Code/HelloClass.cs

A compilation error occurs if I try to use any code contained in my Application Code folder. I have included the entire / websitedemo / folder in this archive if it helps to fix the error: http://kivin.ca/websitedemo/source.zip

I left the folder in debug mode. The compilation error screen can be viewed at http://kivin.ca/websitedemo/

Sincerely.

- update:

If this helps to fix this error, I got this behavior when I try to deploy ASP.NET WebApplication instead of a website.

In the event that my aspx file contains @Page right like this:

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

Compilation error: "Parser error message: Failed to load type" myproj._Default ".

Webapps are deployed via ftp using Build β†’ Publish β†’ [X] Replace the corresponding files, [X] Only the files needed to run this application. [X] Include the App_Data folder.

+3
source share
4 answers

. . - , , , . - .

Softsys.

+1

DLL ( HelloClass) bin, , .

0

HelloClass.cs

0

http://msdn.microsoft.com/en-us/library/54dwfbb7.aspx

I think this may help you ... if you have subfolders

also, app_code was introduced in the framework 2.0, can you verify that the web application in real time is installed as a framework 2.0? otherwise the classes will not be compiled there

0
source

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


All Articles