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

150
Views
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
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!