Teamcity 8 Code Inspection Errors

Hi we just upgraded to TeamCity 8.0 build 27402 and now have 41 code inspection errors. They all are regarding Linq code and am not sure how to resolve the errors

The following is a list of the errors:

  1. Incorrect argument types. Candidates are: Public Function Where(Of InsuranceLabel)(IEnumerable(Of InsuranceLabel), Func) As IEnumerable(Of InsuranceLabel) (in Class Enumerable) Public Function Where(Of InsuranceLabel)(IEnumerable(Of InsuranceLabel), Func) As IEnumerable(Of InsuranceLabel) (in Class Enumerable)
  2. Cannot resolve symbol 'ToList'
  3. Cannot convert type 'lambda expression' to parameter type 'System.Linq.Expressions.Expression(Of System.Func`2)'
  4. Type arguments cannot be inferred from the usage. Try specifying type arguments explicitly. Candidates are: Public Function References(Of TOther)(Expression(Of Func)) As ManyToOnePart(Of TOther) (in Class ClasslikeMapBase(Of Chart)) Public Function References(Of TOther)(Expression(Of Func)) As ManyToOnePart(Of TOther) (in Class ClasslikeMapBase(Of Chart))
  5. Cannot convert type 'lambda expression' to parameter type 'FluentNHibernate.Mapping.Providers.IComponentMappingProvider'


These errors only occur when running the Teamcity code inspections. If we open the solution up on our developer machines with Resharper there are no solution analysis errors and the code compiles without any errors.

Here is the corresponding code that the code inspection is saying causes the above errors, I changed the line that is causing the code inspection error to be red:

     1)
        Dim insuranceAPI As New HCSInsurance
        Dim AllInsurance As List(Of InsuranceLabel) = insuranceAPI.RetrieveInsuranceList()
        Dim MedicarePPSList As List(Of InsuranceLabel) = AllInsurance.Where(Function (ins) ins.Name = "MEDICARE PPS").ToList()
        Dim MedicareInsID As SynergyUserID = MedicarePPSList(0).InsuranceCode
        Dim MedicareInsurance As Insurance = insuranceAPI.RetrieveInsurance(MedicareInsID)
        Assert.AreEqual(RenderingProvider.None, MedicareInsurance.RenderingProvider)

        MedicareInsurance.RenderingProvider = RenderingProvider.Agency
        insuranceAPI.UpdateInsurance(MedicareInsurance)
        MedicareInsurance = insuranceAPI.RetrieveInsurance(MedicareInsID)
        Assert.AreEqual(RenderingProvider.Agency, MedicareInsurance.RenderingProvider)

     2)
        Dim query = From b In New AccountFeeContext("421") Where b.AgencyCode = 1

        Dim feeSchedules As List(Of AccountFeeSchedule) = query.ToList()


     3) Using FluentNHibernate.Mapping
        Table("DBA.t_intake")
        Id(Function(x As Chart) x.GUID, "GUID")
        Map(Function(x As Chart) x.IntakeCode).CustomType(GetType(SynergyIDUserType)).Columns.Clear.Columns.Add("intakecode").Columns.Add("GUID")
        Map(Function(x As Chart) x.PatientID).CustomType(GetType(SynergyUserIDUserType)).Columns.Clear.Columns.Add("patientcode").Columns.Add("patientcode_GUID")
        Map(Function(x As Chart) x.SOC, "soc").CustomType(GetType(SynergyDateUserType))
        Map(Function(x) x.MedicalRecordNumber, "medicalrecordno")
        Map(Function(x) x.FaceToFaceDate, "FaceToFaceDate").CustomType(GetType(SynergyDateUserType))
        Map(Function(x) x.InactiveStatusDate).CustomType(GetType(SynergyDateUserType)).Formula("(SELECT MAX(t_status.statusdate) FROM DBA.t_status WHERE t_status.intakecode_GUID = GUID and t_status.statustype in (2,7))")
        References(Function(x) x.MyPatient).Column("patientcode_GUID")
        References(Function(x) x.CurrentPhysician).Column("currentphysiciancode_GUID")
        References(Function(x) x.CurrentCaseAdministrator).Column("currentadmincode_GUID")


     4)
        Table("DBA.t_intake")
        Id(Function(x As Chart) x.GUID, "GUID")
        Map(Function(x As Chart) x.IntakeCode).CustomType(GetType(SynergyIDUserType)).Columns.Clear.Columns.Add("intakecode").Columns.Add("GUID")
        Map(Function(x As Chart) x.PatientID).CustomType(GetType(SynergyUserIDUserType)).Columns.Clear.Columns.Add("patientcode").Columns.Add("patientcode_GUID")
        Map(Function(x As Chart) x.SOC, "soc").CustomType(GetType(SynergyDateUserType))
        Map(Function(x) x.MedicalRecordNumber, "medicalrecordno")
        Map(Function(x) x.FaceToFaceDate, "FaceToFaceDate").CustomType(GetType(SynergyDateUserType))
        Map(Function(x) x.InactiveStatusDate).CustomType(GetType(SynergyDateUserType)).Formula("(SELECT MAX(t_status.statusdate) FROM DBA.t_status WHERE t_status.intakecode_GUID = GUID and t_status.statustype in (2,7))")
        References(Function(x) x.MyPatient).Column("patientcode_GUID")
        References(Function(x) x.CurrentPhysician).Column("currentphysiciancode_GUID")
        References(Function(x) x.CurrentCaseAdministrator).Column("currentadmincode_GUID")


     5)
        Table("DBA.t_patient")
        Id(Function(x) x.ID, "GUID")
        Map(Function(x) x.PatientId).CustomType(GetType(SynergyUserIDUserType)).Columns.Clear.Columns.Add("patientcode").Columns.Add("GUID")
        Component(Function(x) x.PatientName)
        Component(Function(x) x.PatientAddress)



Thanks,

Damien
6 comments
Comment actions Permalink

Hello, Damien Thank you for so detailed description of the issue!
Could you please also provide build log as well? Are there any errors?

0
Comment actions Permalink

I have attached the build log. It does not seem to be any errors in the build log.

Damien



Attachment(s):
HealthCare_Assistant_Analyze_Code_6.9.21.51.log.zip
0
Comment actions Permalink

Any word on this,

We are using TeamCity Professional 8.0.3 (build 27540) and it is still happening today. Developers are using Resharper 8.0.1 and the code inspection errors do not occur on the development machines. These error are only reported from the code inspections on the TeamCity build agents.

0
Comment actions Permalink

I'm seeing this with the latest version of InspectCode (version 8.0.0.0), both on TeamCity (7.1 (using the command line as the Inspect Code step uses an older version of InspectCode.exe)) and stand-alone (run locally).

The errors I'm seeing are ALL related to NHibernate, and across several projects that reference NHibernate e.g.

      <Issue TypeId="CSharpErrors" File="src\Whatever.cs" Offset="660-673" Line="21" Message="Cannot resolve symbol 'Configuration'" />
      <Issue TypeId="CSharpErrors" File="src\Whatever.cs" Offset="1783-1798" Line="49" Message="Cannot resolve symbol 'ISessionFactory'" />
      <Issue TypeId="CSharpErrors" File="src\Whatever.cs" Offset="2797-2812" Line="74" Message="Cannot resolve symbol 'ISessionFactory'" />
      <Issue TypeId="CSharpErrors" File="src\Whatever.cs" Offset="3009-3024" Line="78" Message="The alias 'NhConfiguration' has no constructors defined" />
      <Issue TypeId="CSharpErrors" File="src\Whatever.cs" Offset="3062-3081" Line="79" Message="Cannot resolve symbol 'ProxyFactoryFactory'" />
      <Issue TypeId="CSharpErrors" File="src\Whatever.cs" Offset="3082-3108" Line="79" Message="Cannot resolve symbol 'DefaultProxyFactoryFactory'" />
      <Issue TypeId="CSharpErrors" File="src\Whatever.cs" Offset="3246-3262" Line="83" Message="Cannot resolve symbol 'ConnectionString'" />
      <Issue TypeId="CSharpErrors" File="src\Whatever.cs" Offset="3341-3348" Line="84" Message="Cannot resolve symbol 'Dialect'" />
      <Issue TypeId="CSharpErrors" File="src\Whatever.cs" Offset="3349-3365" Line="84" Message="Cannot resolve symbol 'MsSql2008Dialect'" />
      <Issue TypeId="CSharpErrors" File="src\Whatever.cs" Offset="3402-3408" Line="85" Message="Cannot resolve symbol 'Driver'" />
      <Issue TypeId="CSharpErrors" File="src\Whatever.cs" Offset="3409-3428" Line="85" Message="Cannot resolve symbol 'Sql2008ClientDriver'" />
      <Issue TypeId="CSharpErrors" File="src\Whatever.cs" Offset="3465-3474" Line="86" Message="Cannot resolve symbol 'BatchSize'" />
      <Issue TypeId="CSharpErrors" File="src\Whatever.cs" Offset="3514-3528" Line="87" Message="Cannot resolve symbol 'IsolationLevel'" />
      <Issue TypeId="CSharpErrors" File="src\Whatever.cs" Offset="3609-3620" Line="90" Message="Cannot resolve symbol 'ModelMapper'" />
      <Issue TypeId="CSharpErrors" File="src\Whatever.cs" Offset="3708-3718" Line="92" Message="Cannot resolve symbol 'HbmMapping'" />
      <Issue TypeId="CSharpErrors" File="src\Whatever.cs" Offset="3760-3803" Line="92" Message="Cannot resolve symbol 'CompileMappingForAllExplicitlyAddedEntities'" />
      <Issue TypeId="CSharpErrors" File="src\Whatever.cs" Offset="3840-3850" Line="94" Message="Cannot resolve symbol 'AddMapping'" />
      <Issue TypeId="CSharpErrors" File="src\Whatever.cs" Offset="3907-3926" Line="96" Message="Cannot resolve symbol 'BuildSessionFactory'" />

0
Comment actions Permalink

Hi

I had this error when TeamCity was upgrade from v8.0 to v8.1. My code used AutoMapper in the class that suddenly starting getting lots of errors like the following:

Cannot resolve symbol 'Code'
Cannot resolve symbol 'Ignore'
Cannot resolve symbol 'DebugItems'
Cannot resolve symbol 'Ignore'
Cannot resolve symbol 'RootTiming'


I think that installing .net 4.0.3 (http://support.microsoft.com/kb/2468871) patch or newer should fix it from the discussion on the AutoMapper issue for it: https://github.com/AutoMapper/AutoMapper/issues/383#issuecomment-33482087 

I'm still waiting for this to be verified as I'm not allowed to install the patch on my TC build agent but though I'd post this here for the other sufferers.

Hope it works!

0
Comment actions Permalink

I just updated to version 9 of TeamCity and am still getting these errors in the code inspections:

73: Incorrect argument types. Candidates are: Public Function Where(Of SynergyNameValue)(IEnumerable(Of SynergyNameValue), Func) As IEnumerable(Of SynergyNameValue) (in Class Enumerable) Public Function Where(Of SynergyNameValue)(IEnumerable(Of SynergyNameValue), Func) As IEnumerable(Of SynergyNameValue) (in Class Enumerable)
74: Incorrect argument types. Candidates are: Public Function Where(Of SynergyNameValue)(IEnumerable(Of SynergyNameValue), Func) As IEnumerable(Of SynergyNameValue) (in Class Enumerable) Public Function Where(Of SynergyNameValue)(IEnumerable(Of SynergyNameValue), Func) As IEnumerable(Of SynergyNameValue) (in Class Enumerable)

Could it because the type SynergyNameValue is defined in a portable class library project? I have noticed other inspection like Cannot resolve symbol 'Money' and Money is defined in a portable class library.

Please let me know as this issue has been plagueing us for quiet sometime know.

Thanks,
0

Please sign in to leave a comment.