Unable to start the RavenDB Server -> The framework 'Microsoft.AspNetCore.App', version '3.1.4' was not found.

544 views
Skip to first unread message

Justin A

unread,
Jun 17, 2020, 9:59:20 PM6/17/20
to RavenDB - 2nd generation document database
I'm just trying to do a real, quick and simple RavenDb unit test in basically an empty, new project:

    <PackageReference Include="RavenDB.TestDriver" Version="4.2.103" /> 

...

    public class SetupRavenDbTests : RavenTestDriver
    {
        [Fact]
        public void GivenTheBareMinimum_SetupRaveDb_SetsUpADatabase()
        {
            // Arrange.
            var documentStore = GetDocumentStore();

            // Act.
            // Stuff here...

            // Assert.
            var statistics = documentStore.Maintenance.Send(new GetStatisticsOperation());
            statistics.CountOfDocuments.ShouldBe(0);
            statistics.Indexes.Length.ShouldBe(0);

            documentStore.Dispose();
        }
    }

Okay - nothing hard.

When I run this test, I get this error:

System.InvalidOperationException : Unable to start the RavenDB Server
    Error:
    It was not possible to find any compatible framework version
    The framework 'Microsoft.AspNetCore.App', version '3.1.4' was not found.
      - The following frameworks were found:
          2.1.0 at [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
          2.1.1 at [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
          2.1.2 at [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
          2.1.4 at [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
          2.1.5 at [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
          2.1.6 at [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
          2.1.7 at [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
          2.1.8 at [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
          2.1.9 at [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
          2.1.11 at [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
          2.1.12 at [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
          2.1.13 at [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
          2.1.19 at [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
          2.2.0 at [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
          2.2.2 at [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
          2.2.3 at [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
          2.2.5 at [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
          2.2.6 at [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
          2.2.7 at [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
          2.2.8 at [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
          3.1.5 at [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
    
    You can resolve the problem by installing the specified framework and/or SDK.
    
    The specified framework can be found at:
    
Ok - I understand the error message and I understand the solution (i need to _also_ install an older version of ASP.NET CORE).

So my question is -> can this be done 'better'? Like, is there any way we can rely on a nuget version instead of a pre-installed version?

It feels potentially error-prone/frustrating to have to make sure that a specific version of aspnet SDK is installed.

I think the real frustration is actually that this is a RUNTIME error. If it was a compile time ... I feel like I could handle that (mentally) a bit quicker/easier ?

I donno... what do other people think?

-me-

Egor Shamanaev

unread,
Jun 18, 2020, 2:31:11 AM6/18/20
to RavenDB - 2nd generation document database
Hi,

.net Core 3.1.5 was released 1 week ago, and all packages will be update in the next stable release, I don't think we can do anything "better" here, because the exception is clearly says the cause and provides a solution.

Justin A

unread,
Jun 18, 2020, 4:24:50 AM6/18/20
to RavenDB - 2nd generation document database
Yep agreed that the expception message is very very helpful (yay!!) but was just curious if there was a way to take the dependency in a _different way_? like could the nuget package not rely on an _installed_ version of the sdk ... versus just raw nugets?

Dislaimer: i'm not experienced with the details of all this magical nuget stuff about how MS moved away from a bazillion nugets to 1 or so uber package reference, etc.

-me-

Paweł Pekról

unread,
Jun 18, 2020, 5:05:47 AM6/18/20
to RavenDB - 2nd generation document database
Hi,

there is a possibility to use latest installed runtime, by setting 'null' in 'FrameworkVersion' of `ServerOptions` (https://ravendb.net/docs/article-page/4.2/csharp/start/test-driver#configureserver). This might be acceptable for your case (testing), but we would prefer you, our user, to make that call, because newer frameworks contains stability fixes, and what we think is more important, security fixes. So from our perspective this is prioritized first.

If you want to have 'automatic' setup, then you can create an instance of 'ServerOptions' and read the value of a 'FrameworkVersion' property. Then you can download that runtime, unzip it and set it in 'ServerOptions.DotNetPath' programatically.

The problem with using NuGet as a container for runtimes is that it needs to contain all of the runtimes for all of the platforms where .NET core can be used. Each runtime is 60mb+, so we are talking here about packages of 200mb+.

Justin A

unread,
Jun 18, 2020, 8:13:17 AM6/18/20
to RavenDB - 2nd generation document database
Thanks Pawel for the reply :)

I wasn't aware that all the dependencies required for the TestDriver would be that massive :/ 

I'll just accept the issue as what it is. It's definitely not a massive deal -> it's a test case and all test cases would be ran locally before code is committed, so it wouldn't be weird runtime issue on a production system.

What's weird thought is i swear I thought i had that version of the SDK installed ... guess i didn't... weird... Unless VS update did some weird stuff. Who knows.

Cheers all, for the help!

-me-
Reply all
Reply to author
Forward
0 new messages