Compiler Warning when saving BPM after recent Kinetic updates

Kinetic Cloud 2023.2.9

Recently, I’ve been getting a “Compiler Warning” when editing/saving a BPM. I’ve not seen this before. I’m curious if anyone else has seen this. It doesn’t seem to affect the BPM functioning.

This is the warning message:

InTran.Sync.cs(319,35): warning ECF1002: The ‘System.IO.Compression.GZipStream.GZipStream(System.IO.Stream, System.IO.Compression.CompressionMode)’ constructor cannot be called.
InTran.Sync.cs(325,24): warning ECF1002: The ‘System.IO.Compression.GZipStream.Read(byte, int, int)’ method cannot be called.
InTran.Sync.cs(820,1): warning ECF1002: The ‘System.IO.File.AppendAllText(string, string?)’ method cannot be called.

I have not seen that one, but we have an issue with the update breaking the passing of data between screens in App Studio to Function that did work. Had to do a workaround to fix it. Not sure what the actual issue is from a system standpoint so I have not submitted it on Epicare, and usually stuff like that falls on deaf ears anyway. I am sure the next patch will fix it, lol
Thanks for the update though, nice to know when we run across something others have also so we don’t spend too much time debugging something.

Interesting to know as well. Yes, I have a case open with Epicare and not getting anywhere. They suggest it’s has to do with “custom code”. (shrug). Many of our BPM’s were created by Epicor. I always find it funny how they send you here! :slight_smile:

Does the workstation that is saving the BPM have the .NET 6 runtime installed? Even though not used by the client, the server is running it and the compile happens at the client.

Hi @Mark_Wonsil
To the best of my knowledge, it does. Support sent me the link to I and I downloaded and installed it.

Their suggestions have included re-compiling and export/import of the BPM’s. I have tried both.

I noticed this first in our Pilot system. Then tested in Production and it was doing it too.

I was able to get it to stop on many of the BPM’s in Pilot but, not in Production. Which seems odd.

Jose already created a list of restrictions here

1 Like

Feedback response from Epiccare:

We discussed your issue in our Team Meeting today and found out that this warning is coming from a different BPM that is on the same table. You can safely ignore it.

They are related to the custom code in the BPMs and will go away in the 2024.1 release this spring.

I want to clarify that these warnings are not going away with 2024.1. The warnings are intentional and are highlighting custom code patterns that we have identified as being problematic. The problems include security, performance and data integrity. The set of warnings will continue evolving as we identify more patterns to avoid.

The warnings will not stop your code from compiling or running. However, in the future, these warnings will become errors. So do heed them and consider alternatives.

I opened an existing (working) bartender BPM we have set up as a JobHead data directive & changed a printer string. Now we get a compile error when I save it. It works (ignoring it).

If Epicor is making this a hard stop error in future releases, we should fix it now.

How do we fix it? Is System.IO.File.WriteAllLines no longer a good way to create bartender labels?

Here’s the offending part:

System.IO.File.WriteAllLines("\\\\e10bartend\\Commander\\Scan\\JobPartLabels\\" + "Label " + JobNum.ToString() + ".bt", contents);

Full code:

PostTran.BOMLabelV2.cs(450,1): warning ECF1002: The ‘System.IO.File.WriteAllLines(string, string)’ method cannot be called.
PostTran.BOMLabelV2.AsyncHost.cs(137,1): warning ECF1002: The ‘System.IO.File.WriteAllLines(string, System.Collections.Generic.IEnumerable)’ method cannot be called.

//Create Bartender Script File
string printer = Printer;
string headers = "?";
string label = "C:\\Commander\\GScreen_1x2.btw";
string copies = Quantity.ToString();

var datas = (
from e in Db.JobMtl.With(LockHint.NoLock)
where 
e.Company == "<masked>" && e.JobNum == JobNum 
orderby e.BoxColor_c, e.MtlSeq ascending
select new { e.PartNum, e.Description, e.MtlSeq, e.IUM, e.RequiredQty, e.BoxColor_c} ).Distinct().ToArray().Select( e =>  $"{e.PartNum}, {e.IUM}, {e.Description}, {e.MtlSeq},  {e.RequiredQty}, {e.BoxColor_c}" );

//Splitting up MaxMtlSeq Into an Array
string[] MtlSeqList = MaxMtlSeq.Split(',');

//Bartender Header Information
string text = string.Format("%BTW% /AF=\"{0}\" /D=\"<Trigger File Name>\" /PRN=\"{1}\"  /R=3 /C={2} /P ", label, printer, copies);

//Column Headers
headers = string.Format("\"{0}\",\"{1}\",\"{2}\",\"{3}\",\"{4}\",\"{5}\",", new object[]
{
  "PartNum",
  "IUM",
  "PartDescription",
  "MtlSeq",
  "RequiredQty",
  "BoxColor_c"
});


//Printing specific labels based on what is in MaxMtlSeq

if (MaxMtlSeq == "ALL")
{
  datas = (
  from e in Db.JobMtl.With(LockHint.NoLock)
  where 
  e.Company == "<masked>" && e.JobNum == JobNum 
  select new { e.PartNum, e.Description, e.MtlSeq, e.IUM, e.RequiredQty, e.BoxColor_c}  ).Distinct().ToArray().Select(e =>  $"{e.PartNum}, {e.IUM}, {e.Description}, {e.MtlSeq},  {e.RequiredQty}, {e.BoxColor_c}" );
}
else if (MaxMtlSeq != "" && MaxMtlSeq != "ALL" )
{
  datas = (
  from e in Db.JobMtl.With(LockHint.NoLock)
  where 
  e.Company == "<masked>" && e.JobNum == JobNum && MtlSeqList.ToList().Contains(e.MtlSeq.ToString())
  select new { e.PartNum, e.Description, e.MtlSeq, e.IUM, e.RequiredQty, e.BoxColor_c}  ).Distinct().ToArray().Select( e =>  $"{e.PartNum}, {e.IUM}, {e.Description}, {e.MtlSeq},  {e.RequiredQty}, {e.BoxColor_c}" );
}

string[] bartenderInfo = new string[]
{
      text,
      "%END%",  //bartender footer
      headers,
      //datas
};

var contents = bartenderInfo.Concat(datas);
       
System.IO.File.WriteAllLines("\\\\e10bartend\\Commander\\Scan\\JobPartLabels\\" + "Label " + JobNum.ToString() + ".bt", contents);
1 Like

Will these be documented somewhere?

We have conflicting information on this from different parts of Epicor, so until they work it out, I’m not really worried about it.

Cloud customers are expected to write to external file shares for certain integrations, including Bartender, EDI, etc.

We have been told by one part of Epicor that they are going to start erroring out on certain things like File writing, while other parts of Epicor have assured us that we will still be able to write to shares where thing like FTP are served from.

Until they provide a wrapper and / or work out their internal issues, I’m not sure if we should do anything.


IMHO, with the move to AKS, most of these proposed restrictions do not make any sense. Why cripple the tooling? We pay a lot for the flexibility we have.

If the customer does something dumb with the tooling, the customer should deal with the consequences. (Stupid should hurt.)

3 Likes

image

You may post your reply to my message queue…

2 Likes