X12Reader exception

Post author
Alex Kushner

MissingMethodException: Method not found: 'System.Reflection.Emit.AssemblyBuilder System.AppDomain.DefineDynamicAssembly(System.Reflection.AssemblyName, System.Reflection.Emit.AssemblyBuilderAccess)'.

My Code:

public class ImportController : Controller
{
private static Import im = new Import("");
private FileInfo[] files;

//File location to always be known
public IActionResult ImportView()
{
var outFile = AppContext.BaseDirectory + "..\\..\\..\\test\\test.xml";
//To be replaced by MessageQueue
files = new DirectoryInfo(AppContext.BaseDirectory + "..\\..\\..\\test\\")
.GetFiles("*.edi")
.ToArray();
foreach (FileInfo f in files)
{
using (var stream = new MemoryStream(System.IO.File.ReadAllBytes(f.ToString())))
{
// Create Global list of edi items. All EDI Fabric edi types inherits IEdiItem
List<IEdiItem> ediItems;
// Create EDI Fabric X12 reader and provide classification of supported edi types and version
using (var reader = new X12Reader(stream, TemplateFactory.FullTemplateFactory))

***** Error occurs on above line

Comments

1 comment

  • Comment author
    Admin

    Check your TemplateFactory.FullTemplateFactory - does Assembly.Load work with the assemblies you are trying to load? It's either the assemblies are missing or the assembly name is wrong.

     

    0

Please sign in to leave a comment.