locked
Type Exception is not defined; Visual studio 2010 RRS feed

  • Question

  • User-991436988 posted

    Hi,

    I am pulled into a new project where they use Visual studio 2010 (framework 4.0). I got the latest version off TFS, and tried to build the app. I get errors like "Type Exception is not defined" and "Type Datatable is not defined"; these statements belong to classes in APP_Code folder. To get rid of these error locally i could write Imports System.Data or Imports System and get awat with it. But its a solution on TFS and latest version is supposed to work the way it is.

    I checked web.config file it has all the namespaces and assemblies (following is partial code)

    I even right clicked the properties of web site and checked references; they are all there....

          <namespaces>
            <clear />
            <add namespace="System" />
            <add namespace="System.Collections" />
            <add namespace="System.Collections.Specialized" />
            <add namespace="System.Configuration" />
            <add namespace="System.Data" />
    ........
     
      <add assembly="System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
            <add assembly="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
            <add assembly="System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
            <add assembly="System.Net, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
            <add assembly="Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
          </assemblies>

    so, I am not sure how to build my solution (without adding Import statements) ?

    Any ideas?

    thank you



    Monday, February 25, 2013 4:38 PM

Answers

  • User-1137493631 posted

    did you tried by adding reference by manually  and here are few things from microsoft portal,

    1. Check that the type definition and its reference both use the same spelling.

    2. Check that the type definition is accessible to the reference. For example, if the type is in another module and has been declared Private, move the type definition to the referencing module or declare it Public.

    3. Check that the namespace of the type is not redefined within your project. If it is, use the Global keyword to fully qualify the type name. For example, if a project defines a namespace named <tt xmlns:asp="http://msdn.microsoft.com/asp">System</tt>, the System.Object type cannot be accessed unless it is fully qualified with the Global keyword: <tt xmlns:asp="http://msdn.microsoft.com/asp">Global.System.Object</tt>.

    4. If the type is defined, but the object library or type library in which it is defined is not registered in Visual Basic, click Add Reference on the Project menu, and then select the appropriate object library or type library.

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, February 25, 2013 4:42 PM