Instancias Lentas C#

Asked

Viewed 44 times

0

I am creating an instance of a certain class , and it is taking too long to instantiate . Does anyone know how to solve this ? Suddenly the applications took time to instantiate

code of the class that is taking long to start

    public class Email
    {
        public Email()
        {

        }
        string[] auxVerifica;

        string email, destinatario, rastreio, tipoObjeto;

        String nomeDestinatario;

        StringBuilder resultado = new StringBuilder();
        public void metodoParaenviarEmail(){}

    }

I debugged and it hangs as soon as it gives the new Email command();

  • Yuri, without chunk of code becomes difficult to help, it can be several reasons, until a connection to the database, would have to investigate what the constructor of the class is doing.

  • No. There is no help without relevant information. Show the code, explain better what is expected, what is happening.

  • That’s it , it doesn’t even start the constructor , it takes from the moment I give the comment Email n = new Email();

  • I thought it was the constructor , but the constructor is empty , is locking in time to create the same instance

  • If possible add the code of the Email class to your question

  • Ready I added the class code

Show 1 more comment
No answers

Browser other questions tagged

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