Method Directive Error - Unable to use Custom Code

Hi

Can somebody put me out of my misery, and point me in the direction of what’s changed. I add an Execute Custom code box to any post processing method direction, and even with just a comment line it presents an error:

image

image

Predefined type ‘System.Void’ is not defined or imported.

Thanks
Mark

That’s really odd… is ti the same error if you write something in?

I havent seen that one before. But if I had to guess to point you towards looking at something. Make sure on the Server you have the .NET Core 6 Runtimes for Desktop installed. Also on your PC make sure you have .NET 4.8 atleast or .NET Core 6 SDK (but not required).

Yep - if I uncomment the line, it gets even more excited:

Ice.Diagnostics.Log.WriteEntry("CS Post Pick Count Back"); 

Dare I ask, have you tried turining it on and off again? (recycle the app server / close re-open the client) that is bizarre!

I had similar issues with LINQ on my PC and I had .NET 4.8 and .NET Core 6 SDK installed. I removed the .NET Core 6 SDKs from my PC and left 4.8 and LINQPad was happy. Since we arent on 2021+ yet I havent tried with Epicor.

But it was some conflict of the Runtimes and SDKs.

Partially winning… on the server it doesn’t produce the same error.

On my workstation, I’ve defo got .Net 4.8 installed, but didn’t have .NET Code 6 SDK. Just installed it, but no different. Will play about with the runtimes and SDKs you mention and feedback. Thanks @hkeric.wci

Did you figure out what the conflict was? I am having a similar issue with functions in the “Epicor Functions Library”.

open a cmd window or powershell and post back the results of these two commands:

dotnet --list-sdks

dotnet --list-runtimes

I am jumping in here with this same error when running an updateable BAQ. The BAQ works and updates, but it would be nice to find out what we are missing.
We moved up to Kinetic 2022.1.16.
I do not have a problem running the BAQ on the server.
When run on clients, we get a long slew of errors. Below is one small piece.

Input mapping expression for ‘PartTran.Company’ field is invalid: Predefined type ‘System.Void’ is not defined or imported
The type ‘Object’ is defined in an assembly that is not referenced. You must add a reference to assembly ‘System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’.
Predefined type ‘System.Object’ is not defined or imported
Predefined type ‘System.String’ is not defined or imported

Here are the results of the cmd from my client.

C:\Users\scottg>dotnet --list-sdks

C:\Users\scottg>dotnet --list-runtimes
Microsoft.NETCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

From my pc I see that I am on 4.8.
C:\Windows\Microsoft.NET\Framework\v4.0.30319
From the properties of one of the dll.
.NET Framework
4.8.4084.0
Scott

You have no SDKs at all.

Go here and install the latest .Net 6 sdk

https://dotnet.microsoft.com/en-us/download/dotnet/6.0

Thanks Kevin
I installed, but I still have that error. I will take this off to another post.
Scott

You made sure you chose the SDK I’m assuming.

I just tested and can’t see any issues in 2022.2.5.

There are no issues with the software, this is a local machine problem.

Assume nothing with my understanding of what I am doing here.
From my server. 6.0.401 [C:\Program Files\dotnet\sdk]
From my client. 6.0.404 [C:\Program Files\dotnet\sdk]
I am collecting all of the variables to go to support.
S

The sdk must be installed on the CLIENT doing the programming.

Not according to Epicor they say SDK 6 is optional. Not true eh? :slight_smile:

Kiss it, I did have a very old one installed when we last talked, I was just looking at the wrong thing :slight_smile:

Problem solved.
Fresh install on client seemed to fix whatever was missing. I will create new post on what I found.

1 Like