Jerry Welliver
Jerry Welliver

Reputation: 377

Upgrade 18R1 to 19R2 Failed to resolve type reference

I have a customization package in 18R1 and I am trying to upgrade to 19R2. During the upgrade I get a compilation error:

Validating Binary Files
LingoEDI.dll Failed to resolve type reference: PX.SM.SiteMapMaint declared in PX.Data, 
Version=1.0.0.0, Culture=neutral, PublicKeyToken=3b136cac2f602b8e
LingoEDI.dll Failed to resolve type reference: PX.Objects.Common.PXOrderedSelect`5 declared in 
PX.Objects, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
Fixed binding: Document from PX.Objects.SO.SOShipmentEntry
Fixed binding: Transactions from PX.Objects.SO.SOOrderEntry
Fixed binding: Adjustments from PX.Objects.AR.ARPaymentEntry
Fixed binding: ARInvoice_DocType_RefNbr from PX.Objects.AR.ARPaymentEntry

Does anyone have an idea how to resolve this? How do I trace it back to the offending code? The project was compiled in Studio 2017 .NET 4.7.1 C# 6.

Follow-up After compiling with 19R2, I am getting compile errors trying to delete site map entries via a plugin. It appears that SiteMapMaint has been removed. Do you know how to remove site map entries in 19R2?

Code:

//Site map graph
SiteMapMaint graph = PXGraph.CreateInstance<SiteMapMaint>();

//Check all the site maps for this screen
foreach (SiteMap smap in PXSelect<SiteMap, Where<SiteMap.screenID, Equal<Required<SiteMap.screenID>>>>
    .Select(graph, screenID))
{
    parentDescription = "";
    SiteMap siteMapParent = PXSelect<SiteMap, Where<SiteMap.nodeID, Equal<Required<SiteMap.nodeID>>>>
    .Select(graph, smap.ParentID);

    //Do not delete hidden site map entries
    if (siteMapParent != null)
    {
        parentDescription = siteMapParent.ScreenID + siteMapParent.Title;
        if (siteMapParent.ScreenID == "HD000000")
        {
            //this.WriteLog(string.Format("Site map '{0}' is hidden ", screenID));
            continue;
        }
    }

    //Remove site map entry from visible entry
    if (smap != null)
    {
        graph.Caches[typeof(SiteMap)].PersistDeleted(smap);
        this.WriteLog(string.Format("Site map '{0}' removed. '{1}' ", smap.Title, parentDescription));
    }
}
return;

Errors:

Severity    Code    Description Project File    Line    Suppression State
Error   CS0021  Cannot apply indexing with [] to an expression of type 'method group'   LingoEDI    C:\Program Files (x86)\Acumatica ERP\18R10816_19R20170\App_Data\Projects\LingoEDI\LingoEDI\EDIDataSetup.cs  138 Active
Error   CS0246  The type or namespace name 'SiteMapMaint' could not be found (are you missing a using directive or an assembly reference?)  LingoEDI    C:\Program Files (x86)\Acumatica ERP\18R10816_19R20170\App_Data\Projects\LingoEDI\LingoEDI\EDIDataSetup.cs  114 Active
Error   CS0246  The type or namespace name 'SiteMapMaint' could not be found (are you missing a using directive or an assembly reference?)  LingoEDI    C:\Program Files (x86)\Acumatica ERP\18R10816_19R20170\App_Data\Projects\LingoEDI\LingoEDI\EDIDataSetup.cs  114 Active

Upvotes: 0

Views: 565

Answers (1)

Hugues Beaus&#233;jour
Hugues Beaus&#233;jour

Reputation: 8278

You need to make sure it was compiled against the target Acumatica version.

Right click on the C# project in solution explorer pane, select Unload Project option. Right click on the C# project in solution explorer pane, select Edit XYZ.csproj.

In the project definition, make sure all PX assembly paths point to the Bin folder of the website where the customization will be deployed.

<Reference Include="PX.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=3b136cac2f602b8e, processorArchitecture=MSIL">
  <SpecificVersion>False</SpecificVersion>
  <HintPath>C:\AcumaticaSites\TargetWebsite\Bin\PX.Common.dll</HintPath>
</Reference>
<Reference Include="PX.Data, Version=1.0.0.0, Culture=neutral, PublicKeyToken=3b136cac2f602b8e, processorArchitecture=MSIL">
  <SpecificVersion>False</SpecificVersion>
  <HintPath>C:\AcumaticaSites\TargetWebsite\Bin\PX.Data.dll</HintPath>
</Reference>
<Reference Include="PX.Objects, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
  <SpecificVersion>False</SpecificVersion>
  <HintPath>C:\AcumaticaSites\TargetWebsite\Bin\PX.Objects.dll</HintPath>
</Reference>

Right click on the C# project in solution explorer pane, select Reload Project option.

Try to compile the project, it will likely fail because PXOrderedSelect type was moved to a different namespace or assembly. Fix the compilation error by adding the required using clause then recompile and update the customization project with the new DLL file.

Upvotes: 1

Related Questions