Issue #86 resolved
Robert Baker
created an issue

Error 1 Running transformation: System.ArgumentNullException: Value cannot be null. Parameter name: key at System.Collections.Generic.Dictionary`2.FindEntry(TKey key) at TypeLite.TypeResolver.ResolveModule(String name) in C:_PROJECTS\TypeLITE\TypeLite\TypeResolver.cs:line 130 at TypeLite.TypeResolver.VisitClass(TsClass classModel) in C:___PROJECTS\TypeLITE\TypeLite\TypeResolver.cs:line 42 at TypeLite.TsModel.RunVisitor(ITsModelVisitor visitor) in C:_PROJECTS\TypeLITE\TypeLite\TsModel.cs:line 74 at TypeLite.TsModelBuilder.Build() in C:___PROJECTS\TypeLITE\TypeLite\TsModelBuilder.cs:line 145 at Microsoft.VisualStudio.TextTemplating097C215A707CB07DE5AACDA590F263DF8554A0CCA899B583BF1832F7C0C5D3E595312AE41D3DFD1BB9CA643458AA5D86FE3DBA281ED0000D4B4C1D87EA1DEFFB.GeneratedTextTransformation.TransformText() C:\Users\rbaker\Documents\Visual Studio 2013\Projects\ClassLibrary1\ClassLibrary1\Scripts\TypeLite.Net4.tt 1 1 ClassLibrary1

First I tried running in my web project but my system.http was newer and it refused to work. Then I took my models, created a test project. and now I get this.

Fix the reflection issue already and please fix this.

Comments (5)

  1. Lukas Kabrt repo owner

    Hello,

    it seems, that there is some problem with the module definition for your classes. Do you use custom modules name [TsClass(Module=...)]? Are your classes inside a namespace? It would be best, if you can share the source code that causes the problem.

  2. Robert Baker reporter
    using System;
    using TypeLite;
    
    
        [TsClass]
        public class Location
        {
            public int LocationId { get; set; }
            public string Name { get; set; }
            public string LocationCode { get; set; }
            public int LocationGroupId { get; set; }
            public string Region { get; set; }
            public bool Active { get; set; }
            public int SiteId { get; set; }
            public int DefaultTaxGroupId { get; set; }
            public bool Exported { get; set; }
            public int TaxationMethod { get; set; }
            public int DefaultCurrencyId { get; set; }
            public int LocationTypeId { get; set; }
            public int Registers { get; set; }
            public double TotalArea { get; set; }
            public double SalesArea { get; set; }
            public int WebAddressId { get; set; }
            public int PosTypeId { get; set; }
            public int ActivityId { get; set; }
            public int CostDistributionTypeId { get; set; }
            public DateTime LastUpdated { get; set; }
        }
    
        [TsClass]
        public class LocationType
        {
            public int LocationTypeId { get; set; }
            public string LocationTypeName { get; set; }
        }
    
        [TsClass]
        public class LocationGroup
        {
            public int LocationGroupId { get; set; }
            public int ParentLocationGroupId { get; set; }
            public string GroupCode { get; set; }
            public string Name { get; set; }
            public int Tier { get; set; }
            public bool Active { get; set; }
            public string Description { get; set; }
            public int AccountMonthlyClosingDay { get; set; }
            public bool ReportingBit { get; set; }
        }
    
        [TsClass]
        public class Addresses
        {
            public int AddressId { get; set; }
            public string AddressLine1 { get; set; }
            public string AddressLine2 { get; set; }
            public string AddressLine3 { get; set; }
            public string AddressLine4 { get; set; }
            public string City { get; set; }
            public string PostalCode { get; set; }
            public string PostalCodeExtension { get; set; }
            public string Territory { get; set; }
            public string IsoCountryCode { get; set; }
            public int CultureId { get; set; }
            public string Company { get; set; }
        }
    
        [TsClass]
        public class SiteContacts
        {
            public int SiteId { get; set; }
            public int AddressId { get; set; }
            public int EmailAddressId { get; set; }
            public int TelephoneId { get; set; }
            public int FaxTelephoneId { get; set; }
            public int ContactMethodTypeCode { get; set; }
        }
    
        [TsClass]
        public class EmailAddresses
        {
            public int EmailAddressId { get; set; }
            public string EmailAddressString { get; set; }
        }
    
        [TsClass]
        public class Telephones
        {
            public int TelephoneId { get; set; }
            public string ItuCountryCode { get; set; }
            public string TelephoneNumber { get; set; }
        }
    
        [TsClass]
        public class IsoCountry
        {
            public int CultureID { get; set; }
            public string IsoCountryCode { get; set; }
            public string Name { get; set; }
            public string CultureDisplayName { get; set; }
            public string ItuCountryCode { get; set; }
        }
    
        [TsClass]
        public class WebAddress
        {
            public int WebAddressId { get; set; }
            public string WebAddressString { get; set; }
        }
    
        [TsClass]
        public class Site
        {
            public int SiteId { get; set; }
            public string TimeZoneCode { get; set; }
        }
    
  3. Robert Baker reporter

    So I to make sure all my models were in the same namespace, it didn't like myname.subname.

    I had to remove public virtual methods. Those should just be ignored.

  4. Log in to comment