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

218
Views
C# No se pudo encontrar el tipo o el nombre del espacio de nombres 'List'. Pero estoy importando System.Collections.Generic;

estoy teniendo un error

No se pudo encontrar el tipo o el nombre del espacio de nombres 'List'. ¿Te falta una directiva de uso o una referencia de ensamblado?

Código de muestra:

 using UnityEngine; using System.Collections; using System.Collections.Generic; public class city1 : MonoBehaviour { public static List<string> items = new List (); public static List<double> itemsprice = new List(); public static List<double> qu = new List(); }

Estoy usando mono si importa.

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

El problema proviene de su creación de instancias de new List() . Estos también necesitan el componente genérico:

 public static List<string> items = new List<string>(); public static List<double> itemsprice = new List<double>(); public static List<double> qu = new List<double>();

Es decir, no existe un tipo List pero sí un tipo genérico List<T> .

Puede encontrar más información y ejemplos de creación de instancias de la List<T> genérica en la documentación de MSDN .

over 4 years ago · Santiago Trujillo Report

0

Prueba esto:

public static List<string[]> items = new List<string>();

Agregar corchetes después de la cadena

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!