locked
Project runs locally but not when published RRS feed

  • Question

  • User1782147992 posted

    I have created a fairly simple ASP web forms project, that is working just fine on my local machine.  However when I published it to the web host I am running into some issues.  The first page loads and is able to access the database and all is good.  However when I attempt to go to the second page it is failing.  This page is making a call to a class called States and is located in the App_Code folder.  I am getting the following 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 'States' could not be found (are you missing a using directive or an assembly reference?)

    Source Error:

    Line 8:  public partial class adventureState : System.Web.UI.Page
    Line 9:  {
    Line 10:     public States thisState = new States();
    Line 11:     public string State { get; set; }
    Line 12:     public DataSet DS { get; set; }

    I have tried adding a Namespace to the class and a using statement to the current page but this just gives me the same error on the using statement.

    This is my first attempt at publishing a asp page and any help would be greatly appreciated.

    Tuesday, April 3, 2018 7:24 PM

All replies

  • User475983607 posted

    I assume this is a WebSite project?  Did you remember to deploy the App_Code and all its contents? Did you deploy the bin directory al all it its contents?

    https://msdn.microsoft.com/en-us/library/t990ks23.aspx

    Tuesday, April 3, 2018 7:44 PM
  • User1782147992 posted

    Yes I used VS to publish the project via FTP and the App_code and Bin folders are their.

    Tuesday, April 3, 2018 7:59 PM
  • User475983607 posted

    Yes I used VS to publish the project via FTP and the App_code and Bin folders are their.

    The error is telling you that it cannot find 'States'.  This happens if the assembly with States is not deployed.  Again, did yo make sure the App_code folder contains the source code file that has State?  Did you verify the bin folder has all the expected DLLs?  Basically, does the local file system match the server?

    Tuesday, April 3, 2018 9:16 PM