Cannot find classes once ASP.NET website is hosted

171 Views Asked by At

My project is an ASP.Net website that connects to an SQL database. It compiles fine locally in Visual Studio, but once it is hosted (myWindowsHosting.com) it throws this error:

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. 

 Compiler Error Message: CS0246: The type or namespace name 'IDefaultView' could not be found (are you missing a using directive or an assembly reference?)

Source Error:

Line 9:  namespace HFDB2
Line 10: {
Line 11:     public partial class Default : System.Web.UI.Page, IDefaultView
Line 12:     {
Line 13:         public event EventHandler btnNextClicked;

In this example I am trying to implement an Interface to the Default webform. But a similar error occurs for any class I try to reference.

Why cant my project find any classes once it is hosted?

Does it have anything to do with my folder structure?

enter image description here

My classes are not in an App_Code folder because apparently you dont need one for websites. I tried putting them in an App_Code folder anyway, but it gave a different error.

Note that I uploaded everything you see inside my project folder to the host.

1

There are 1 best solutions below

0
On BEST ANSWER

I was deploying my application incorrectly. As Ben Robinson's comment says:

Never deploy source code. The easiest way of creating your collection of files to deploy is to use the Publish option in visual studio.