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

Support for older .NET Frameworks #196

Closed
leopignataro opened this issue Jun 8, 2017 · 6 comments
Closed

Support for older .NET Frameworks #196

leopignataro opened this issue Jun 8, 2017 · 6 comments

Comments

@leopignataro
Copy link

Dear testfx team,

Are there plans to support older .NET Frameworks, such as 4.0 (and perhaps even 3.5)?

This seems to be a gap. On the MS docs topic Developing Libraries with Cross Platform Tools, net40 is even suggested as a good baseline:

If you want to reach the maximum number of developers and projects, use the .NET Framework 4.0 as your baseline target.

However, test projects created with "dotnet new mstest" and targeted to net40 don't run with "dotnet test". The reason for this seems to be that the packages MSTest.TestAdapter and MSTest.TestFramework don't support .NET Framework 4.0.

We have a class library multitargeted to .NET Frameworks 4.0 and 4.5, currently working on adding support for .NET Standard 2.0. We currently have separate test projects for each supported platform, with a trick to reuse the actual test code. It would be wonderful to have a single test project.

@AbhitejJohn
Copy link
Contributor

@leopignataro : Thanks for bringing this up. There aren't any plans to support .Net 4.0 or lower in the near future given the delta in terms of support matrix from net40 to net45 isn't large. We haven't also heard back from a lot of users about wanting this.

On a side note, the core of MSTest V2 is built for netstandard 1.0 (equivalent to net45) so it works cross-platform. Moving it to net40 would require a code split and a bunch of #if statements since not all the APIs we require are similar in lower .net frameworks.

/cc: @pvlakshm.

@abatishchev
Copy link

What prevents you from targeting the latest and greatest framework from your tests? You always can continue to target whatever you'd like from the app itself.

@igitur
Copy link

igitur commented Aug 22, 2017

@abatishchev One often wants to test features specifically designed around older targets. I have a lot of #if _NET35_ conditional compiler statements in my code where I have to introduce workarounds because of lacking features in .NET3.5. I definitely want to have unit tests for those workarounds.

@abatishchev
Copy link

@igitur fair point, thanks for the explanation

@leopignataro
Copy link
Author

Precisely as @igitur explained. Moreover, it is not uncommon for packages to have different dependencies for each target platform. Therefore, it is important to test each implementation, which might rely on an entirely different set of dependencies.

@pvlakshm
Copy link
Contributor

Please see comment. This is not in plan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants