These warnings will become errors in the future

What are we expected to do about the new compiler warnings showing up in 2024.1?

warning ECF1002: The ‘System.Reflection.MemberInfo.Name’ property cannot be read.

warning ECF1002: The ‘System.IO.File.Open(string, System.IO.FileMode, System.IO.FileAccess, System.IO.FileShare)’ method cannot be called.

warning ECF1002: The ‘System.IO.StreamReader.StreamReader(string)’ constructor cannot be called.

warning ECF1002: The ‘System.IO.File.Open(string, System.IO.FileMode, System.IO.FileAccess, System.IO.FileShare)’ method cannot be called.

Move to on-prem? :house: sigh

1 Like

@klincecum will tell you…
spongebob squarepants kevin GIF

1 Like

That’s what I was counting on . . .

1 Like

Sean Connery Villain GIF by James Bond 007

Vote on Kevin’s idea.

1 Like

Obviously. But what else? Just wait for all my shit to break?

You go vote & comment on my Epicor idea, and convince them this is nuts and overkill.

I mean, I have access to the Db object. I can erase everything. Why in the world does it matter if I want to look at some properties, or load a class, or retrieve a file?

If you are crazy enough to write where you aren’t supposed to and you screw it up, that’s on you, not Epicor, so why do they care? Tell the dummy customer to pound sand, not take my tools away.

This is going to absolutely make my life miserable, and it doesn’t make any sense.

If there was still shared hosting with custom code, for sure, I could see it, but that no longer exists.

This is gonna be in you on-prem guys codebase too most likely, so don’t get cocky.


If you love me, or if you love freedom.

free freedom GIF

Roll back Custom Code Restrictions that are no longer relevant with the move to AKS

2 Likes

Yes I already voted. So you are saying there isn’t any workaround? We’re just at Epicor’s mercy?

Sad Season 1 Episode 1 GIF by NBC

3 Likes

Well, if you have a specific use case, maybe we can think of alternate ways to pull off what you need. But as a general what can we do about this error message… Unless you know whose shins need to be whacked at Epicor, I don’t think there is any cure.

Well yes, depending on what exactly you are doing, we may be able to provide a workaround.

Gonna have to share a bit more.

1 Like

Well the one I am looking at right now parses a csv file and saves it to a UD table. Can it be done with DMT? Sure but. . . why should we have to when we already have this nice interface for it? I don’t understand Epicor’s logic in taking this away from us at all.

But we could just not upgrade and live the good life with flexible custom code and classic screens :rofl:

4 Likes

I’m familiar with that codebase, The io can be worked around, kinda clunky.

The reflection is probably just for the function name.

Link it up or post it up.

I won’t fault you for that. Jealous? Sure, but I won’t be mad.


try
{
CallService<Ice.Contracts.ServerPathSvcContract>(serverPathSvc =>
{
    List<Ice.Lib.ServerPath.Types.PathInfo> pathInfo = new List<Ice.Lib.ServerPath.Types.PathInfo>();
    
    pathInfo = serverPathSvc.GetPaths(Epicor.ServiceModel.Utilities.SpecialFolder.CompanyData, "", false);
    
    if(pathInfo.Count > 0)
    {
        string filePath = $"{pathInfo.First().FullName}";

bool locked = true;

do
{
  locked = false;
  try
  {
      FileStream fs =
          File.Open(Path.Combine(filePath, FileName), FileMode.Open,
          FileAccess.Read, FileShare.None);
      fs.Close();
  }
  catch (IOException ex)
  {
      locked = true;
  }
}
while( locked );

using( StreamReader sr = new StreamReader(Path.Combine(filePath, FileName)) )
{
  //string row = "";
  string row;
  DataSet thisDS = new DataSet();
  thisDS.Tables.Add("CSVRows");
  DataTable dt = thisDS.Tables["CSVRows"];
  
  Regex CSVParser = new Regex(",(?=(?:[^\"]*\"[^\"]*\")*(?![^\"]*\"))");
  
            string[] headers = sr.ReadLine().Split(',');
            foreach (string header in headers)
            {
                dt.Columns.Add(header);
            }

            while(!string.IsNullOrEmpty(row = sr.ReadLine()))
            {
                
                  string[] cols = CSVParser.Split(row); 
                  var dr = dt.NewRow();
                  for(int i = 0; i < cols.Count(); i++)
                  {  
                     dr[i] = cols[i].ToString().Replace("\"","");
                  }
                  dt.Rows.Add(dr);
            }
            
     
  OutDS = thisDS;
}

    }
});
}
catch(Exception ex)
{
  eMessage = ex.Message;
}

1 Like

I think the System.IO was covered last year:

partially

@aosemwengie1 Yes, all of that can be worked around.

I don’t currently have time to do it, but most of it can be found if you poke around in this post.
I have a mix of stuff in there, some allowed, some not. If you can’t piece it together, or someone else doesn’t step up, I’ll see if I can help when I get back from the beach.

https://www.epiusers.help/t/dump-database-table-to-csv-file-in-epicordata-folder/117317

Have we heard from any of the Epicor folks on this yet? @timshuwy , @Olga , @Rich , @Epic_Santiago

Thanks, I will take a look.

1 Like