Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

658
Views
El nombre 'Subproceso' no existe en el contexto actual

Cuando pongo este código Thread.Sleep(2000); me da el error:

El nombre 'Subproceso' no existe en el contexto actual`.

Ya incluí el espacio de nombres using System.Threading; . Consulte System.Threading.Thread.Sleep() en MSDN .

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Supongo que se trata de un proyecto Portable Class Library o Windows Store/Phone dirigido a Windows Runtime que no tiene tal construcción.


Una forma alternativa y recomendada sería usar:

await Task.Delay(TimeSpan.FromSeconds(2));

o para una llamada de bloqueo en caso de que no esté en un contexto asíncrono:

Task.Delay(TimeSpan.FromSeconds(2)).Wait();

En esta publicación también se presenta un problema similar.

over 4 years ago · Santiago Trujillo Report

0

Intente usar el espacio de nombres completo en su código:

 System.Threading.Thread.Sleep(1000);
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!