Question

Compiling error when working on a package set as a separate assembly

Hi, 

I'm trying to compile the code below from a package set as a a separate assembly but I'm getting the error attached even though the object mentioned on the error is part of the package. 

 

What am I missing?

 

Thanks,

Jose

 

Error:

Object exists on package

Code generating the error:

using System;

using System.Collections.Generic;

using System.Linq;

using Terrasoft.Core;

using Terrasoft.Core.Entities;

using Terrasoft.Configuration;    



public class UsrPPDRCorrespondenceHelper

{

    private UserConnection UserConnection { get; }

    

    public UsrPPDRCorrespondenceHelper(UserConnection userConnection) {

        UserConnection = userConnection;

    }

    

    public Guid GetStatus(Guid corrId) {        

        var esq = new EntitySchemaQuery(UserConnection.EntitySchemaManager, "UsrPPDRCorrespondence");

        esq.AddAllSchemaColumns();

        Entity queryResult = esq.GetEntity(UserConnection, corrId);

        if (!(queryResult is UsrPPDRCorrespondence corr)) {

            throw new Exception($"Unable to get Correspondence status for ID {corrId}");

        }

        if (corr.UsrStatus == null) {

            throw new Exception($"Correspondence status for ID {corrId} is empty");

        }

        return corr.UsrStatus.Id;

    }

 }

Like 0

Like

1 comments

Hi,

 

According to the error UsrPPDRCorrespondence is not located at the same folder (directory to which assembly files were exported) as the source code that is being compiled.

 

Best regards,

Oscar

Show all comments