Search code examples
c#entity-framework-5com+sqlanywheretypelib

Failed to generate type library for iAnywhere.Data.SQLAnywhere


What could be the reason of this error when I tried to build a c# solution with class like this:

using iAnywhere.Data.SQLAnywhere;

 /// Specify a name for your serviced component
    [ ProgId( "Name" ) ]
    /// Add content to hosting COM+ App's description field
    [ Description("Name")]
    /// Configure component's Transaction Option, configure transaction isolation level so only a shared lock is placed for read
    [Transaction(TransactionOption.Supported,
          Isolation = TransactionIsolationLevel.ReadCommitted)]
    /// Configure component's object pooling
    [ObjectPooling(Enabled = true, MinPoolSize = 1, MaxPoolSize = 20, CreationTimeout = 60000)]
    /// Specify COM+ Context Attributes
    [MustRunInClientContext(false)]
    /// Enable event tracking
    [EventTrackingEnabled(false)]
    /// Enable JITA for the component
    [JustInTimeActivation(false)]
    /// Enable Construction String Support for the component
    [ConstructionEnabled(Enabled = false)]
    /// Configure activity-based Synchronization for the component
    [Synchronization(SynchronizationOption.Required)]
    /// Indicate the type of class interface that will be generated for this class
    [ClassInterface(ClassInterfaceType.AutoDual)]

    [GuidAttribute("xxxx")]

It returns error:

Error   Failed to generate type library 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\iAnywhere.Data.SQLAnywhere.v4.0\v4.0_16.0.0.19484__f222fc4333e0d400\iAnywhere.Data.SQLAnywhere.v4.0.tlb' for 'iAnywhere.Data.SQLAnywhere.v4.0, Version=16.0.0.19484, Culture=neutral, PublicKeyToken=f222fc4333e0d400'.

Solution

  • When I tried to register the assembly through the console. It shows:

    An unknown exception occurred during installation:
    1: System.IO.FileNotFoundException - Could not load file or assembly 'EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.
    

    It turns out that after I installed the EntityFramework, Version=5.0.0.0, problem solved.