Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

153
Vistas
Why does Visual Studio accept PriorityQueue?

I'm writing a program that needs a priority queue, and it would be nice if I could use the one that comes with .Net 6: https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.priorityqueue-2?view=net-6.0

So I've tried writing some sample code (in F#, but this particular code fragment could be written just the same in C# and I would expect the results to be the same):

open System.Collections.Generic

...

let pq = PriorityQueue()
pq.Enqueue("apple", 5)
pq.Enqueue("banana", 6)
checkEq (pq.Dequeue()) "apple"
checkEq (pq.Dequeue()) "banana"

Visual Studio is perfectly happy with that, autocomplete worked and everything.

I try to compile it, and fsc is not at all happy:

C:\olivine\src\test.fs(1345,14): error FS0039: The value or constructor 'PriorityQueue' is not defined.

Maybe that's because I don't have the right version of .Net installed.

reg query "HKLM\SOFTWARE\Microsoft\Net Framework Setup\NDP" /s

Needless to say, there seem to be dozens of versions installed, but the highest version numbers I am seeing, appear to be 4.x, which would explain why fsc is not happy.

But then what's up with Visual Studio? How did it accept and understand the reference to PriorityQueue, despite .Net 6 being apparently not installed on the machine?

over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda