using class file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • natalievl
    New Member
    • Sep 2007
    • 2

    #1

    using class file

    Hi,

    I am using Visual WebDeveloper 2005 Express Edition and am having trouble using a C# class file

    I am using

    <% @Import Namespace="CEma il" %>

    and the class file is name CEmail.cs and is saved in the App_Code folder of my project.

    The file builds ok locally and all is working, but as soon as I upload the project to another server, i get the message:



    Compilation 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 'CEmail' could not be found (are you missing a using directive or an assembly reference?)

    Source Error:

    Line 12: <% @Import namespace="Syst em.Web.UI.HtmlC ontrols" %>
    Line 13:
    Line 14: <% @Import Namespace="CEma il" %>


    Can someone please tell me what I am doing wrong.

    Thanks in advance!



    Natalie.
  • Shashi Sadasivan
    Recognized Expert Top Contributor
    • Aug 2007
    • 1435

    #2
    Have you tried putting the complete namespace in there?

    So go to the CEmail class and check which namespace it belongs to until you can trace it back to your projects name

    So it should look something like YourProjectName .SomeotherNames pace.CEmail

    cheers
    Last edited by Shashi Sadasivan; Sep 28 '07, 05:38 AM. Reason: getting the filename right

    Comment

    • dip_developer
      Recognized Expert Contributor
      • Aug 2006
      • 648

      #3
      Originally posted by natalievl
      Hi,

      I am using Visual WebDeveloper 2005 Express Edition and am having trouble using a C# class file

      I am using

      <% @Import Namespace="CEma il" %>

      and the class file is name CEmail.cs and is saved in the App_Code folder of my project.

      The file builds ok locally and all is working, but as soon as I upload the project to another server, i get the message:



      Compilation 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 'CEmail' could not be found (are you missing a using directive or an assembly reference?)

      Source Error:

      Line 12: <% @Import namespace="Syst em.Web.UI.HtmlC ontrols" %>
      Line 13:
      Line 14: <% @Import Namespace="CEma il" %>


      Can someone please tell me what I am doing wrong.

      Thanks in advance!

      Natalie.
      Are your CEmail.cs class residing in another project???..... .I think so.....becuse if this is the case then I suspect you need the appropriate assembly reference....ot herwise if CEmail.cs resides in the same project from where you are calling it then you can easily import it......

      Comment

      Working...