Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-3798

Cannot install 2.13.1 MongoDB.Driver in latest Visual Studio Code

    • Type: Icon: Task Task
    • Resolution: Works as Designed
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None

      Hello,

      I've tried to write a 'hello world' like C# application for MongoDB and I'm blocked on installing the MongoDB.Driver:

       

      PS C:\Users\User\Documents\csharp> dotnet add package MongoDB.Driver --version 2.13.1
      Determining projects to restore...
      Writing C:\Users\User\AppData\Local\Temp\tmp8F31.tmp
      info : Adding PackageReference for package 'MongoDB.Driver' into project 'C:\Users\User\Documents\csharp\csharp.csproj'.
      info : Restoring packages for C:\Users\User\Documents\csharp\csharp.csproj...
      error: NU1100: Unable to resolve 'MongoDB.Driver (>= 2.13.1)' for 'net5.0'.
      error: Package 'MongoDB.Driver' is incompatible with 'all' frameworks in project 'C:\Users\User\Documents\csharp\csharp.csproj'.

       

      The csproj file states:

      <Project Sdk="Microsoft.NET.Sdk">
        <PropertyGroup>
          <OutputType>Exe</OutputType>
          <TargetFramework>net5.0</TargetFramework>
        </PropertyGroup>
        <ItemGroup>
          <PackageReference Include="MongoDB.Driver" Version="2.13.1"/>
        </ItemGroup>
      </Project>
      

      And the only SDK installed is 5.0.400:

      dotnet --list-sdks 
      5.0.400 [C:\Program Files\dotnet\sdk]
      

       

      Torsten

            Assignee:
            james.kovacs@mongodb.com James Kovacs
            Reporter:
            torsten.spindler@mongodb.com Torsten Spindler
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: