Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Writing test for .net 5 project using .net 6 runtime #393

Open
grinay opened this issue Nov 12, 2021 · 9 comments
Open

Writing test for .net 5 project using .net 6 runtime #393

grinay opened this issue Nov 12, 2021 · 9 comments
Assignees
Labels

Comments

@grinay
Copy link

grinay commented Nov 12, 2021

It's always hard to write integrations tests and eventually, I found your project. This is an amazing solution. Thanks for your efforts on this.
I setting up tests for a new project to which I sign up. And trying to use it.
However when I execute test it throughs the exception
"This version of MyTested.AspNetCore.Mvc only supports ASP.NET Core 5.0 applications but the 6.0.0 web framework was"
The project is written with .net 5 and .net 6 able to run it without any issue. I can set up .net 5 but I'm already moved to new apple silicon and .net 5 works very slow on m1. Is there any way to disable runtime framework checks?

@grinay
Copy link
Author

grinay commented Nov 13, 2021

@ivaylokenov would it be this kind of code appropriate?

 public static class TestFramework
    {
        public const string TestFrameworkName = "MyTested.AspNetCore.Mvc";
        public const string ReleaseDate = "2021-07-01";
        public const string VersionPrefix = "5.0";

        internal static void EnsureCorrectVersion(DependencyContext dependencyContext)
        {
            if (!dependencyContext.Target.Framework.EndsWith(VersionPrefix))
            {
                throw new InvalidOperationException(
                    $"This version of {TestFrameworkName} only supports target framework ASP.NET Core {VersionPrefix}");
            }
        }
    }

@ivaylokenov
Copy link
Owner

@grinay I will publish packages for .NET 6 in a week. Stay tuned!

@grinay
Copy link
Author

grinay commented Nov 25, 2021

@ivaylokenov thanks.)

@arjanh76
Copy link

Hi @ivaylokenov , first of all: great work on this super useful package that I have used in several projects already.
I was wondering when the version for .NET 6 will be published since we're migrating to it and of course would like to migrate the unit tests for our controllers as well without rework ;)
Thanks in advance!

@grinay
Copy link
Author

grinay commented Dec 30, 2021

Hi @ivaylokenov any update on .net 6 version?

@arjanh76
Copy link

arjanh76 commented Feb 10, 2022

@grinay I will publish packages for .NET 6 in a week. Stay tuned!

Any update on this? Can we expect a .net 6 version in the near future?

@botrot
Copy link

botrot commented Mar 11, 2022

Hi Ivo, can we expect dotnet 6 soon, if money is needed we can also provide some?
@ivaylokenov

@Sinkarq
Copy link

Sinkarq commented Apr 4, 2022

@ivaylokenov Yeah, it will be highly appreciated (.NET 6)

@negberts
Copy link

+1

@elzik elzik mentioned this issue Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants