.Net app, I need to create an Epicor session it getting errors

Hello,

I am trying to create an Epicor session in my .Net application and I keep getting errors. I found this way to establish connection in this forum:

Session EpiSession = new Session("scanner", "scanner", Session.LicenseType.Default, @"C:\Prog\Epicor102600\Client\config\Test-Dev.sysconfig");
            {
// do whatever
}

I keep getting error about Ice.Epicor.Version or one of it's dependency unable to find file...

The references I added are as follows:
image

Here is the error:
image

What Am I missing ?

Thanks

Pierre

English error messages? :rofl:

Pierre,

Can you launch Epicor from that workstation using that config file?

1 Like

Yes!
I have removed the references, and add them back from C:\Prog\Epicor102600\Client
Now I got a different error about communication…

System.Reflection.TargetInvocationException
HResult=0x80131604
Message=Une exception a été levée par la cible d’un appel.
Source=mscorlib
StackTrace:
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)

Inner Exception 1:
CommunicationObjectFaultedException: L’objet de communication System.ServiceModel.Channels.ServiceChannel ne peut pas être utilisé pour la communication car il est dans l’état Faulted.

Is it a .Net Framework App or .Net Core? I don’t think a .Net Core apps can talk directly to Epicor dlls…

The references look right. Are you referencing those files from the full client install folder so they can find their dependencies?

You may also want to consider talking to Epicor via the Rest API.

Brett

1 Like

.Net framework.

I redid the references pointing from the client folder and got the latest error message.

I do not get it.

From another app I developped for testing the DLL’s , in order to simulate using them as we implement them in Epicor, it all works fine, but not this one.

Pierre

Any error in the event viewer on the server?

1 Like

Could not distinguish any…

But redid all the references again… and it worked!

Thanks for the input…

Pierre

Not to beat a dead horse, but that goes away with REST.

1 Like

I know…but I have not found the time to experiment with it…and cannot see this happening in a near future… so much to do and I am alone… ;(

There is a ton of features I have not touched… like functions… I need to take a month of vacation and be full time on it to be able to upgrade my knowledge!!! :thinking:

Pierre

1 Like

Functions are life! I couldn’t live without them go-forward

You’re never alone on EpiUsers.help! We’re here for you, mon chum. (I think that’s right in Canada, non?)

1 Like

Try using the Ice.Core.Session instead of EpiSession like I have below…

string userID = ConfigurationManager.AppSettings[“EpicorUser”];
string password = ConfigurationManager.AppSettings[“EpicorPass”];

Ice.Core.Session session = new Ice.Core.Session(userID, password, Ice.Core.Session.LicenseType.EnterpriseProcessing, @“C:\Epicor\DevTech\Client\config\DevEnvironment.sysconfig”);
Erp.Proxy.BO.QuoteImpl quote = Ice.Lib.Framework.WCFServiceSupport.CreateImpl<Erp.Proxy.BO.QuoteImpl>(session, Erp.Proxy.BO.QuoteImpl.UriPath);

Session comes from Ice.Core.session EpiSession is the variable name…

Oops… Looked at it wrong. What are your current errors?