locked
Deploying the ClubSite / Namespace could not be found RRS feed

  • Question

  • User1945167935 posted
    Hi all,
      I followed the following steps to deploy the ClubSite to my host

    1- Created the ClubSite database using the .sql file , and it was successful.
    2- Modified the web.config file and made the connection string point to the sql server.
    3- Uploaded all the ClubSite files into the ftp server.

    Now when i try to open the site i get the following error :


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

    Source Error:


    Line 1:  <%@ Page Language="c#" MasterPageFile="Default.master" Title="Untitled Page" %>
    Line 2: <%@ Register TagPrefix="Club" TagName="ImageThumbnail" Src="ImageThumbnail.ascx" %>
    Line 3: <%@ Register TagPrefix="Club" Namespace="Clubsite" %>
    Line 4: <script runat="server">
    Line 5:


    I know that asp.net 2.0 should compile the files in the App_Code folder which contains the code defining the ClubSite namespace, but for some reasons registering this namespace fails, so i was wondering if i need to add an assembly reference to the name space (eventhough in the asp.net documentation it says that it's not required) ?
    I also tried using visual studio 2005 to create a deployment project and then to create a release of that project and copy the .dll library generated to the /bin directory in my website, this still didn't work.

    I would appreciate any help to fix this problem,
    Regards,
    Tarek
    Tuesday, April 25, 2006 5:50 AM

All replies

  • User1945167935 posted
    Good news, i managed to fix the above problem, it turned out that it happened because i was storing the App_Code folder inside a sub folder not in the web application root , so by moving that folder up to the root  i by passed that error. So now it can find that namespace because it will be compiled on start. Now i have another problem :), the website loads fine but when i try to login i get the following error,

    An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    SQLExpress database file auto-creation error:

    The connection string specifies a local Sql Server Express instance using a database location within the applications App_Data directory. The provider attempted to automatically create the application services database because the provider determined that the database does not exist. The following configuration requirements are necessary to successfully check for existence of the application services database and automatically create the application services database:

    1. If the applications App_Data directory does not already exist, the web server account must have read and write access to the applications directory. This is necessary because the web server account will automatically create the App_Data directory if it does not already exist.
    2. If the applications App_Data directory already exists, the web server account only requires read and write access to the applications App_Data directory. This is necessary because the web server account will attempt to verify that the Sql Server Express database already exists within the applications App_Data directory. Revoking read access on the App_Data directory from the web server account will prevent the provider from correctly determining if the Sql Server Express database already exists. This will cause an error when the provider attempts to create a duplicate of an already existing database. Write access is required because the web server accounts credentials are used when creating the new database.
    3. Sql Server Express must be installed on the machine.
    4. The process identity for the web server account must have a local user profile. See the readme document for details on how to create a local user profile for both machine and domain accounts.


    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    My database is on sql 2005 server and my connection string is correct, but it's strange how the description of the error complains about creating an Sql server Express database,  i don't know what am doing wrong now, i tried to find the code where the website accesses the sql server , but all i can find is a call to the stored procedures using my sql server connection string ...

    Any ideas please ???

    Tuesday, April 25, 2006 7:51 PM
  • User1945167935 posted
    Again i was able to do it myself :) i guess waiting for a reply is not that helpful, anyways am posting my solution so that others can benifit from my experience . So here what i had to do
    Edit web.config and add the following lines
    1-  <remove name="LocalSqlServer"/>
    2-  <add name="LocalSqlServer" connectionString="Data Source=<DB_Server>;Integrated Security=false;Initial Catalog=<DB_Name>;User ID=<DB_User>;Password=<DB_password>" providerName="System.Data.SqlClient" />

    Reason  ?
      well it seems that eventhought the connetion script to the sql server is correct but it's not enough, u will need to point to the starter kit database schema which is defined in the LocalSqlServer found in the system.config or machine.config, so provided that you have that schema database installed just override the LocalSqlServer connection string with the one that points to the schema, and that's it. Hopefully no more problems ..

    Regards,
    Tarek
    Tuesday, April 25, 2006 9:15 PM
  • User1275632693 posted

    Hi Tarek,

    Just so you don't feel like you are talking to yourself... :)

     

    Wednesday, April 26, 2006 1:53 PM
  • User2069888697 posted

    Come on Angelo, I think we all did alot of talking to ouselves the first time setting the CSK up.

    Good news is it only gets easier. (ha ha):)

    Wednesday, April 26, 2006 2:05 PM