Error after updating DLL to 4.6

Discussions concerning general integration topics.

Moderator: Phil Barton

ngillet
Posts: 40
Joined: Tue Apr 05, 2016 4:32 pm

Error after updating DLL to 4.6

Post by ngillet »

Hello,

Our custom app developer is getting the following, can anyone help resolves this for us:

These exceptions are coming after the SoftPro Select upgraded to 4.6.3.
Also we have re-build the binary with the latest 4.6.3 client apis.


However, now getting another exception from SoftPro as below while executing

SoftPro.OrderTracking.Client.Orders.IOrderStore orders = ss.GetService<IOrderStore>();

Exception has been thrown by the target of an invocation.The type initializer for 'SoftPro.Select.Client.Formula.FormulaCompilationConfiguration' threw an exception. at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture)
at SoftPro.ClientModel.Server.CreateService(IServiceContainer container, Type serviceType)
at System.ComponentModel.Design.ServiceContainer.GetService(Type serviceType)
at SoftPro.ClientModel.Server.GetService(Type serviceType, Boolean ensureAuthenticated)
at SoftPro.Select.Client.SelectServer.GetService(Type serviceType)
at SoftPro.Select.Client.SelectServer.GetService[T]()
at SoftProAPI.DocumentImage.GetDocumentsForOrder(Order o, String role)
joble
Posts: 10
Joined: Mon Aug 19, 2019 11:57 pm

Re: Error after updating DLL to 4.6

Post by joble »

I have tried with even taking all the dll of SoftPro Select of 4.6.3 version.
SoftPro.Select.Client.Formula.FormulaCompilationConfiguration -> Can we get the information on this class, is it included in SoftPro.Select.Client.dll or any new dll which is missing in the package for the web application to include?

Exception has been thrown by the target of an invocation.The type initializer for 'SoftPro.Select.Client.Formula.FormulaCompilationConfiguration' threw an exception. at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture)
at SoftPro.ClientModel.Server.CreateService(IServiceContainer container, Type serviceType)
at System.ComponentModel.Design.ServiceContainer.GetService(Type serviceType)
at SoftPro.ClientModel.Server.GetService(Type serviceType, Boolean ensureAuthenticated)
at SoftPro.Select.Client.SelectServer.GetService(Type serviceType)
at SoftPro.Select.Client.SelectServer.GetService[T]()
at SoftProAPI.DocumentImage.GetDocumentsForOrder(Order o, String role)

Appreciating any help on this issue.
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Error after updating DLL to 4.6

Post by BobRichards »

Please provide the source code for GetDocumentsForOrder() so I can help.
Bob Richards, Senior Software Developer, SoftPro
joble
Posts: 10
Joined: Mon Aug 19, 2019 11:57 pm

Re: Error after updating DLL to 4.6

Post by joble »

Hello,
Below is the method for GetDocumentsForOrder

public static List<Object> GetDocumentsForOrder(NewVentureEscrow.Order o, String role) {
//String orderNum = "150263JP";

if (UserAttachments == null) {
UserAttachments = new Dictionary<string, object>();
}
String orderNum = o.ordernumber;
List<Object> orderAttachments = new List<Object>();

// office id = 7 (carlsbad)
NewVentureEscrow.Office office = new NewVentureEscrow.Office(Convert.ToInt32(o.officeid));

/****** Script for SelectTopNRows command from SSMS ******/
String officeSQL = @"SELECT [name],[address1],[address2],[city],[state],[zip],[databasename],[profilestring],[URL] FROM [NewVentureEscrow].[dbo].[Office] WHERE ID = " + o.officeid;
SqlConnection conn = NVEUtils.ServiceHelper.GetSPConnection(office.connectionString);
SqlCommand cmd = new SqlCommand(officeSQL, conn);
SqlDataAdapter DBAdapter;
DataSet ResultsDataSet = new DataSet();
// Run the query and create a DataSet.
DBAdapter = new SqlDataAdapter(officeSQL, conn);
DBAdapter.Fill(ResultsDataSet);
conn.Close();

String URL = URLMissionValley; // default initialization
String profileName = null;

if (ResultsDataSet.Tables[0].Rows.Count <= 0) {
return orderAttachments;
}
/*************************
foreach (DataRow row in ResultsDataSet.Tables[0].Rows) {
URL = row[@"URL"].ToString();
profileName = row[@"profilestring"].ToString();
}
**************************/

if (office.name.Equals("Mission Valley")) {
URL = URLMissionValley;
profileName = ProfileMissionValley;
} else if (office.name.Equals("Scripps")) {
URL = URLChulaVista;
profileName = ProfileScripps;
} else if (office.name.Equals("Chula Vista")) {
URL = URLChulaVista;
profileName = ProfileChulaVista;
} else if (office.name.Equals("Carlsbad")) {
URL = URLCarlsbad;
profileName = ProfileCarlsbad;
} else {
return orderAttachments;
}

try {
using (SelectServer ss = new SelectServer(URL, creds)) {
ss.EnsureAuthenticated();
//var ret = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
orderAttachments = new List<Object>();
SoftPro.Select.Client.Profiles.IProfileManager profileMgr = ss.GetService<SoftPro.Select.Client.Profiles.IProfileManager>();
// list profiles?
var profileList = profileMgr.Profiles.Where(t => t.Enabled);
var profiles = profileMgr.Profiles.Where(t => t.Path == profileName);

IProfile profile = profileMgr.FindProfile(profileName);
profileMgr.ActiveProfile = profile;
try {

SoftPro.OrderTracking.Client.Orders.IOrderStore orders = ss.GetService<IOrderStore>();
IQueryable<IOrderInfo> info = orders.Orders;
IOrderInfo myInfo = info.Where(oi => oi.Number == orderNum).FirstOrDefault();
if (myInfo == null) return orderAttachments;
IOrder order = null;
try {
order = orders.OpenOrder(myInfo);
//order = orders.OpenOrder(myInfo, true);
} catch (Exception e) {
StringBuilder sb = new StringBuilder();
sb.Append(e.Message + (e.InnerException == null ? "" : e.InnerException.Message) + (e.StackTrace == null ? "" : e.StackTrace) + "\n");
File.AppendAllText("C:\\Logs\\" + "ventureTrac.txt", sb.ToString());
sb.Clear();
String msg = e.Message;
return orderAttachments;
}
if (order == null) return orderAttachments;
IAttachmentFolder attachments = order.Attachments;
var items = attachments.Items;
foreach (Object oItem in items) {
if (oItem is IAttachmentFile == false) { // get FileAttachments from containing folder
/*********** Process Standard Folders (Containers) ****************/
IAttachmentItem attachmentItem = (IAttachmentItem)oItem;
string[] nameParts = attachmentItem.Path.Split('\\');
String NVEFolder = nameParts[nameParts.Length - 2];
if (role.Equals(NVEFolder) == false) {
continue;
}

IAttachmentFolder folder = (IAttachmentFolder)oItem;
var folderItems = folder.Items;
foreach (Object oFolderItem in folderItems) {
if (oFolderItem is IAttachmentFile) {
IAttachmentFile iFile = (IAttachmentFile)oFolderItem;
NVEDocumentObject dObj = new NVEDocumentObject();
dObj.item = iFile;
//Stream s = iFile.GetStream();
Stream s = null;
dObj.stream = s;
dObj.attachmentFolder = NVEFolder;
dObj.orderNo = orderNum;
dObj.URL = URL;
dObj.profileName = profileName;
orderAttachments.Add(oFolderItem);
String k = iFile.ID.ToString();
if (UserAttachments.ContainsKey(k)) {
UserAttachments.Remove(k);
}
UserAttachments.Add(k, dObj); // attachment global cache
}
}
}
}
} catch (Exception e) {
StringBuilder sb = new StringBuilder();
sb.Append(e.Message + (e.InnerException == null ? "" : e.InnerException.Message) + (e.StackTrace == null ? "" : e.StackTrace)+ "\n");
File.AppendAllText("C:\\Logs\\" + "ventureTrac.txt", sb.ToString());
sb.Clear();
String msg = e.Message + (e.InnerException == null ? "" : e.InnerException.Message);
Console.Out.WriteLine(msg);
}
return orderAttachments;
}
} catch (Exception e) {
StringBuilder sb = new StringBuilder();
sb.Append(e.Message + (e.InnerException == null ? "" : e.InnerException.Message) + (e.StackTrace == null ? "" : e.StackTrace) + "\n");
File.AppendAllText("C:\\Logs\\" + "ventureTrac.txt", sb.ToString());
sb.Clear();
string m = e.Message;
return null;
}
}


I am getting this error on this line in the above method


SoftPro.OrderTracking.Client.Orders.IOrderStore orders = ss.GetService<IOrderStore>();


Let me know if you need any additional information to this.

Thanks in advance.

Regards,
Joble
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Error after updating DLL to 4.6

Post by BobRichards »

This question is out of scope for the DevForums. The organization has contacted SoftPro directly and it is being passed to the CSI group.
Bob Richards, Senior Software Developer, SoftPro
ngillet
Posts: 40
Joined: Tue Apr 05, 2016 4:32 pm

Re: Error after updating DLL to 4.6

Post by ngillet »

Hi Bob,

Thank you! Do you know when we can expect to hear back from the CSI group at SoftPro?
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Error after updating DLL to 4.6

Post by BobRichards »

I do not know. That department is not associated with the DevForum.
Bob Richards, Senior Software Developer, SoftPro
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Error after updating DLL to 4.6

Post by BobRichards »

I have received an answer from CSI.
The question above has to do with the user being unable to run a custom package, which happens to be using v4.6 libraries, because of a type load exception when trying to initialize the IOrderStore API. An internal team also ran into this issue (on version 4.5.5) yesterday, and through that, we were able to get to the inner Exceptions, which gave us more information about why the type was not loading.

The Select NuGet package (probably SoftPro.Select.Core…pending investigation) is missing the IronPython assembly reference. When they added a NuGet reference to IronPython (v2.7.3), they were able to get past this error and get their package working.
Bob Richards, Senior Software Developer, SoftPro
joble
Posts: 10
Joined: Mon Aug 19, 2019 11:57 pm

Re: Error after updating DLL to 4.6

Post by joble »

Hi Bob,

I checked the SoftPro 4.6.3 version installed and found that for the below mentioned IronPython.dll also using the 2.7.3 version itself.
Is there any further investigation result on this ?
Or is there any steps that we can apply to resolve this.
deepak.gopinath
Posts: 4
Joined: Mon Apr 03, 2017 2:05 pm

Re: Error after updating DLL to 4.6

Post by deepak.gopinath »

Hi!

The root cause of this issue is being investigated. In the mean time, as a work around, could you try to make a nuget reference to the IronPython reference (v2.7.3) on your project to see if it gets you past the issue you are having during debugging? Is this an issue you only see during a debug session on Visual Studio?

The IronPython module is, like you said, installed on disk with your Select client. So, after the package is registered on Select, you should not see this issue at run time. This should be a development time issue only. Is that not what you are seeing?

Thanks!
Post Reply