Error when doing POST on another project for the second time

Asked

Viewed 36 times

0

Taking as basis this link, that it was myself who posted, I will summarize so that you understand quickly...

I have a . NET Core 2.2 project and needed functionality that I only had in . NET Core 3.0, so I created a . NET Core 3.0 and I am making a request via POST that returns a string that can be a value or an error message...

  1. The mistake that:

erro

  1. When it occurs:

It occurs when you make the second request, i.e., when the project . Net Core 2.2 calls 3.0 for the second time, when executing the method ExecuteInMemoryAssembly, this message appears on the line containing this code: var cr = compilation.Emit(ms);

IMPORTANT: If I stop the project and run again, repeat the situation, therefore the first time works correctly and in the second it gives the error. (In reality he crashes, then automatically the project to).

I looked for here, but I still don’t know how to solve:

E_INVALIDARG: One or more Arguments are not Valid


UPDATE 1:

private static void ExecuteInMemoryAssembly(Compilation compilation)
{
    try
    {
        ...
    }
    catch (Exception ex)
    {
        ex.Message;
    }
    finally
    {
        Dispose();
    }
}    

public void Dispose()
{
    Dispose(true);
    GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
    if (disposed)
        return;
    if (disposing)
    {
        handle.Dispose();
    }
    disposed = true;
}
  • Ever tried to delete files from temporary folder of your PC ? C: WINDOWS Microsoft.NET Framework64"version" Temporary ASP.NET Files.

  • Hello @Andreyschemel, I did what you indicated, the folder was empty... Maybe it’s because I’m using . NET Core... You know there’s time for core too? I’m also layman, it might be that I’m talking nonsense

  • I think it was supposed to be more or less this way, I’m without . NET here, if it’s not this one should be in folders more "above". Another thing that popped into my head is the Disposis method, which frees resources when the class is no longer used (it may be bullshit again).

  • I will put an update with Dispose, also not worked

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.